This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A035490 #23 Feb 16 2025 08:32:37 %S A035490 0,1,2,8,5,4,78,37,6,11,28,12,349,13,383,10,18,16,29,17,33,210,14,133, %T A035490 32,60,19,106,57,20,48,26,21,35,97,217,25,22,13932,863,205,54,30452, %U A035490 306,2591,40,44,39,49,38,51,47,30,252992198,2253,101,112,246,402,119,53,139 %N A035490 Step at which card n appears on top of deck for first time in Guy's shuffling problem A035485. %C A035490 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. %D A035490 D. Gale, Mathematical Entertainments: "Careful Card-Shuffling and Cutting Can Create Chaos," The Mathematical Intelligencer, vol. 14, no. 1, 1992, pages 54-56. %D A035490 D. Gale, Tracking the Automatic Ant and Other Mathematical Explorations, A Collection of Mathematical Entertainments Columns from The Mathematical Intelligencer, Springer, 1998. %H A035490 Lars Blomberg, <a href="/A035490/b035490.txt">Table of n, a(n) for n = 1..10000</a> %H A035490 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PerfectShuffle.html">Perfect Shuffle.</a> %t A035490 riguy[ deck_List ] := Module[ {le=Length[ deck ]}, Flatten[ Transpose[ Reverse@ Partition[ Flatten[ {deck, le+1, le+2 } ], le/2+1 ] ] ] ] %t A035490 Table[ Length[ FixedPoint[ riguy, {}, SameTest->(#2[ [ 1 ] ]=== i &) ] ]/2, {i, 2, 38} ] %o A035490 (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; %Y A035490 Cf. A035485, A035491-A035494, A060750-A060752. %K A035490 nonn,nice %O A035490 1,3 %A A035490 _Wouter Meeussen_ %E A035490 Thanks to Colin Mallows, _David W. Wilson_, Wouter Meeussen and others for helping fill 3 lines - _N. J. A. Sloane_. %E A035490 Additional comments from _David W. Wilson_, Apr 22 2001