sasha
Registered: Oct 2005
Posts: 2 |
computing powers of x
please excuse my lack of correct mathematical nomenclature, but i am curious if there exists a recursive method (algorithm or function) for computing successive values of x^n that only uses addition.
to be precise, for x^3 successive values are:
1,8,27,64,125,... (for integers)
is there a way to go from 27 to 64 to 125 ... w/o taking in the value of x, only using addition, and staying O(1)? if such a method does exist, is it generic for any power of n ( and still O(1) )? where is/would such a method be useful?
thanks in advance for any insight.
Report this post to a moderator | IP: Logged
|