If you are only performing that algorithm once, and you don't need to do anything else at the same time then I suppose you are correct that more wouldn't necessarily help. Although that could still be wrong if the values of a and b are large enough that more cache or RAM would help. And there is also the issue of more RAM possibly allowing other important processes to function more quickly thus enabling the system to process your single addition algorithm in a more timely manner. Once you need to run the algorithm for more than one set of values though you move into territory where parallel processing can improve performance and having more RAM can increase performance by avoiding the need to access slower responding forms of data storage.
Subctraction as a result of adding CPU? I'm not sure how adding resources is supposed to change the actual functionality of your algorithm to do something else entirely. Besides that, you are wrong, that algorithm is already perfectly capable of accomplishing subtraction, as well as multiplication and if I am not mistaken division. All basic arithmetic is actually broken down into an addition equation or series of addition equations by your computer. For instance, subtraction is done through addition once one number is converted to a negative.
More electricity adding new functionality to an algorithm.... I'm really not sure what point you are trying to make that shouldn't already be painfully obvious. Adding a resource does not automatically add completely unrelated functionality or performance increase. It really seems like you are trying to make up nonsensical examples here to no real point. But it does sound fun so I'm going to take a shot at it myself: by giving the AI a ham sandwich it should immediately be able to convert your algorithm into a 5 year plan whereby a hormone free pig can be landed on mars through a green and energy nuetral form of locomotion on Mars, departing from the Earth five minutes before the ham sandwich was delivered.
I would submit that we have met the earlist preconditions for developing an AI superior to ourselves. That was accomplished when the first mechanical calculators were built, or if you prefer when we built the first computers. There is no mystic reason that humans and other animals exhibit intelligence, it is simply the end result of nuerons, among other cells, interacting in an amazingly complex fashion. At its simplest we just need to mechanically/digitally replicate the function of all of those organic parts, with each part interacting according to its own specific set of rules as influenced by the billions, or trillions of other parts. The problem currently with that approach is that we lack the knowledge necessary to code the function of each of those parts, and we aren't even sure we actually know what all of the parts are or how many of each is necessary.