cp's OEIS Frontend

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.

A060750 Step at which card n appears on top of deck for first time in Guy's shuffling problem A035485.

This page as a plain text file.
%I A060750 #13 Mar 02 2021 02:12:32
%S A060750 3,1,2,8,5,4,78,37,6,11,28,12,349,13,383,10,18,16,29,17,33,210,14,133,
%T A060750 32,60,19,106,57,20,48,26,21,35,97,217,25,22,13932,863,205,54,30452,
%U A060750 306,2591,40,44,39,49,38,51,47,30,252992198,2253,101,112,246,402,119,53,139
%N A060750 Step at which card n appears on top of deck for first time in Guy's shuffling problem A035485.
%C A060750 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.
%D A060750 See A035490 for references, links and programs.
%o A060750 (Python)
%o A060750 def a(n):
%o A060750   deck = list(range(1, 2*maxcards+1))
%o A060750   for step in range(1, maxcards+1):
%o A060750     first, next = deck[:step], deck[step:2*step]
%o A060750     deck[0:2*step:2] = next
%o A060750     deck[1:2*step:2] = first
%o A060750     if deck[0] == n: return step
%o A060750   return '>' + str(step)
%o A060750 maxcards = 31000
%o A060750 print([a(n) for n in range(1, 54)]) # _Michael S. Branicky_, Mar 01 2021
%Y A060750 Cf. A035485, A035490, A035491, A035492, A035493, A035494, A060751, A060752.
%K A060750 nonn,nice
%O A060750 1,1
%A A060750 _David W. Wilson_, Apr 22 2001