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 A035485 #27 Feb 16 2025 08:32:37 %S A035485 1,2,3,1,6,5,9,1,4,2,16,10,12,14,23,16,18,20,17,27,30,33,38,10,14,37, %T A035485 32,6,11,19,53,37,25,21,12,34,38,8,50,48,46,14,18,23,47,53,84,52,31, %U A035485 49,1,51,91,61,42,79,4,29,6,49,26,23,115,4,70,93,109,11,16,19,49,18,124,97,70,10,134,111,7,38,14,79,11,129 %N A035485 Card on top of deck at n-th stage of R. K. Guy's shuffling problem. %C A035485 At n-th step, pick up top n cards and interlace them with the next n. %C A035485 Here is the deck after steps 0,1,2,3,4,5: %C A035485 1,2,3,4,5,6,7,... %C A035485 2,1,3,4,5,6,7,... %C A035485 3,2,4,1,5,6,7,... %C A035485 1,3,5,2,6,4,7,8,9,... %C A035485 6,1,4,3,7,5,8,2,9,10,... %C A035485 It is conjectured that eventually every number appears on top of the deck. %C A035485 See A035491 for (the relevant part of) the deck after the n-th step. - _M. F. Hasler_, Aug 13 2022 %D A035485 D. Gale, Mathematical Entertainments: "Careful Card-Shuffling and Cutting Can Create Chaos," The Mathematical Intelligencer, vol. 14, no. 1, 1992, pages 54-56. %D A035485 D. Gale, Tracking the Automatic Ant and Other Mathematical Explorations, A Collection of Mathematical Entertainments Columns from The Mathematical Intelligencer, Springer, 1998. %H A035485 Lars Blomberg, <a href="/A035485/b035485.txt">Table of n, a(n) for n = 0..10000</a> %H A035485 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PerfectShuffle.html">Perfect Shuffle.</a> %F A035485 a(n) = A035491(n,1), i.e., the first element of the n-th row of that table, for all n > 0. - _M. F. Hasler_, Aug 13 2022 %o A035485 (Python) %o A035485 def aupton(terms): %o A035485 alst, deck = [1], list(range(1, 2*terms+1)) %o A035485 for n in range(1, terms+1): %o A035485 first, next = deck[:n], deck[n:2*n] %o A035485 deck[0:2*n:2] = next %o A035485 deck[1:2*n:2] = first %o A035485 alst.append(deck[0]) %o A035485 return alst %o A035485 print(aupton(83)) # _Michael S. Branicky_, Feb 01 2021 %o A035485 (PARI) A035485(n)=A035491_row(n+!n)[1]-!n \\ _M. F. Hasler_, Aug 13 2022 %Y A035485 See A035491 for the array, also A035490, A035492. %K A035485 nonn,easy,nice %O A035485 0,2 %A A035485 _N. J. A. Sloane_, _Clark Kimberling_ %E A035485 More terms from _Jud McCranie_