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