Re: Learning recursion with hailstone seqence



<alanglloyd@xxxxxxx> wrote in message
news:1163758447.067591.220960@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Nov 17, 9:13 am, "Maarten Wiltink" <maar...@xxxxxxxxxxxxxxxxxx>
wrote:

As an aside, I can confidently predict that for 2^1000, the return
value of the above function is 2^999 after recursing exactly 999 times.

I'm no mathematician (although I'm happy with numbers), but after
doing a quick check of values up to 50 I could also predict that.

That statement had very little to do with behaviour for values up to 50,
and everything with the very special structure of the value 2^1000 (in
combination with the definition of the function), and the fact that the
OP forgot to assign the recursed value to Result.

Groetjes,
Maarten Wiltink


.