Juggler Sequence

Author

Eric W. Weisstein
January 25, 2006

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/JugglerSequence.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/JugglerSequence.html.

©2006 Wolfram Research, Inc. except for portions noted otherwise

Code

JugglerSequence[n_,max_:1000]:=FixedPointList[Floor[If[EvenQ[#],#^(1/2),#^(3/2)]]&,n,max]
JugglerNumber[n_,max_:1000]:=FixedPoint[Floor[If[EvenQ[#],#^(1/2),#^(3/2)]]&,n,max]
JugglerLength[n_,max_:1000]:=Length[JugglerSequence[n,max]]-2

Examples

JugglerSequence/@Range[5]//ColumnForm

JugglerSequence[77]

Iterations

Block[{$MaxExtraPrecision=1000},...] only needed for V5.x

Ending Patterns

(If[Length[#]<5,Most[#],Take[#,{-5,-1}]]&/@JugglerSequence/@Range[10^5])//Union//Timing

(10^6)

Take[l=Block[{$MaxExtraPrecision=1000},JugglerLength/@Range[10^6]
],20]//Timing

JugglerNumber/@Range[10^6]//Union//Timing

Union[l]

Last[Transpose[FirstOccurrences[l]]]

HighWaterMarks[l]

(10^7)

Take[l=Block[{$MaxExtraPrecision=1000},JugglerLength/@Range[10^7]
],20]//Timing

134442./3600 Hours

JugglerNumber/@Range[10^7]//Union//Timing

Union[l]

Last[Transpose[FirstOccurrences[l]]]

HighWaterMarks[l]

Plot

<<Utilities`Plot`

Block[{$MaxExtraPrecision=1000},ListPlot[JugglerLength/@Range[500],PlotStyle->{PointSize[.01],Red},PlotRange->All,AxesLabel->TraditionalForm/@{n,HoldForm[l[n]]}]
]