Hailstone sequence: Difference between revisions
Content added Content deleted
(Add Terence Tao presentation.) |
|||
Line 5,916: | Line 5,916: | ||
I use this version to do the validation: |
I use this version to do the validation: |
||
<lang Mathematica>Hailstone[n_] := |
<lang Mathematica>Hailstone[n_] := |
||
NestWhileList[ |
NestWhileList[If[Mod[#, 2] == 0, #/2, ( 3*# + 1) ] &, n, # != 1 &]; |
||