OFFSET
1,1
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 do not accept 0 as a valid number of shuffles and so we say that card #1 first shows up on top after 3 shuffles. A060751 and A060752 also adopt this convention. Alternatively, we can say that card #1 first shows up on top after 0 shuffles; this leads to sequences A035490, A057983, A057984, etc.
REFERENCES
See A035490 for references, links and programs.
PROG
(Python)
def a(n):
deck = list(range(1, 2*maxcards+1))
for step in range(1, maxcards+1):
first, next = deck[:step], deck[step:2*step]
deck[0:2*step:2] = next
deck[1:2*step:2] = first
if deck[0] == n: return step
return '>' + str(step)
maxcards = 31000
print([a(n) for n in range(1, 54)]) # Michael S. Branicky, Mar 01 2021
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
David W. Wilson, Apr 22 2001
STATUS
approved