Hailstone sequence: Difference between revisions

Line 5,896:
 
=== Nested function call formulation ===
<lang Mathematica>HailstoneF[n_] := NestWhileList[If[OddQ@[#], 3 # + 1, #/2] &, n, # > 1 &]</lang>
 
This is probably the most readable and shortest implementation.