It sounds like you're looking for an algorithm to have your passwords be derived from the site they're for, but that's not really necessary, nor a good idea. Use a password manager to keep track of your password for each site and you won't need a way to derive it algorithmically. I believe Password Safe has a good reputation.
Diceware is a decent way to choose random passwords that you can actually remember (so you won't have to consult your password manager every time you log in).