Knuth's power tree: Difference between revisions

Content added Content deleted
m (→‎{{header|Sidef}}: memoize the `path` function)
m (changed a comment in the task's definition section.)
Line 52: Line 52:
Note that for every even integer (in the power tree),   one just squares the previous value.
Note that for every even integer (in the power tree),   one just squares the previous value.


For an odd integer, multiple the previous value with an appropriate odd power of &nbsp; <big>X</big> &nbsp; (which was previously calculated).
For an odd integer, multiply the previous value with an appropriate odd power of &nbsp; <big>X</big> &nbsp; (which was previously calculated).
&nbsp; For the last multiplication in the above example, it would be &nbsp; <big>(43-40)</big>, &nbsp; or &nbsp; <big>3</big>. <br>
&nbsp; For the last multiplication in the above example, it would be &nbsp; <big>(43-40)</big>, &nbsp; or &nbsp; <big>3</big>. <br>