OFFSET
1,3
COMMENTS
Card #1 is initially at the top of the deck and next appears at the top of the deck after 3 shuffles. Here we accept 0 as a valid number of shuffles and so we say that card #1 first shows up on top after 0 shuffles (i.e., initially). A057983 and A057984 also adopt this convention. Alternatively, we can say that card #1 first shows up on top after 3 shuffles; this leads to sequences A060750, A060751, A060752.
REFERENCES
D. Gale, Mathematical Entertainments: "Careful Card-Shuffling and Cutting Can Create Chaos," The Mathematical Intelligencer, vol. 14, no. 1, 1992, pages 54-56.
D. Gale, Tracking the Automatic Ant and Other Mathematical Explorations, A Collection of Mathematical Entertainments Columns from The Mathematical Intelligencer, Springer, 1998.
LINKS
Lars Blomberg, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Perfect Shuffle.
MATHEMATICA
riguy[ deck_List ] := Module[ {le=Length[ deck ]}, Flatten[ Transpose[ Reverse@ Partition[ Flatten[ {deck, le+1, le+2 } ], le/2+1 ] ] ] ]
Table[ Length[ FixedPoint[ riguy, {}, SameTest->(#2[ [ 1 ] ]=== i &) ] ]/2, {i, 2, 38} ]
PROG
(UBASIC) 10 input N; 20 clr time; 30 I=(N-1)\2; 40 while N>1; 50 inc I; 60 if N>I then N=2*(N-I)-1 else N+=N; 70 wend; 80 print I; time; 90 goto 10;
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
Thanks to Colin Mallows, David W. Wilson, Wouter Meeussen and others for helping fill 3 lines - N. J. A. Sloane.
Additional comments from David W. Wilson, Apr 22 2001
STATUS
approved