RosettaCodeData/Task/Hailstone-sequence/Mathematica/hailstone-sequence-2.math

2 lines
86 B
Text
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
HailstoneFP[n_] := Most@FixedPointList[Switch[#, 1, 1, _?OddQ , 3# + 1, _, #/2] &, n]