login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A051732 Number of rounds of shuffling required to restore a deck of n cards to its original order: shuffling is done by keeping first card, putting second at end of deck, keeping next, putting next at end and so on. 7

%I #18 Nov 11 2017 12:53:12

%S 1,1,2,2,3,5,6,6,4,9,4,28,10,9,14,12,5,70,18,24,10,7,210,126,110,60,

%T 26,120,9,29,30,60,6,33,308,42,60,990,30,374,27,41,60,2618,840,840,

%U 420,1386,24,15,50,644,840,53,18,1386,14,13300,2520,1260,55,6930,50,60,7

%N Number of rounds of shuffling required to restore a deck of n cards to its original order: shuffling is done by keeping first card, putting second at end of deck, keeping next, putting next at end and so on.

%C From _Andrew Howroyd_, Nov 11 2017:(Start)

%C The shuffling process is the same as the 'deal one, skip one' method described in A289386 except that dealt cards are placed face up. With this variation the first card always remains the first card.

%C Equivalently, place the numbers 1..n-1 on a circle and cyclically mark the 2nd unmarked number until all numbers are marked. The sequence in which the numbers are marked defines a permutation. The order of this permutation is a(n). The numbers 1..n can also be used, but in that case the number 1 should be marked first.

%C (End)

%H Andrew Howroyd, <a href="/A051732/b051732.txt">Table of n, a(n) for n = 1..2000</a>

%H Gary Antonick, <a href="http://wordplay.blogs.nytimes.com/2016/04/25/finkel-polka-dot/">The Polka Dot Puzzle</a>, NY Times Wordplay blog.

%F a(2^n+1) = n+1. - Ripatti A. (ripatti(AT)inbox.ru), Feb 04 2010

%F a(A163782(n)+1) = A163782(n). - _Andrew Howroyd_, Nov 11 2017

%e From _Andrew Howroyd_, Nov 11 2017: (Start)

%e a(6) = 5 because it takes 5 rounds of shuffling to return the cards to their original order as illustrated below:

%e 1 2 3 4 5 6

%e 1 3 5 2 6 4

%e 1 5 6 3 4 2

%e 1 6 4 5 2 3

%e 1 4 2 6 3 5

%e 1 2 3 4 5 6

%e (End)

%o (PARI)

%o P(n,i)={my(d=2*n+1-2*i); while(d<n, d*=2); 2*n-d}

%o Follow(s,f)={my(t=f(s),k=1); while(t>s, k++; t=f(t)); if(s==t, k, 0)}

%o CyclePoly(n,x)={my(q=0); for(i=1, n, my(l=Follow(i,j->P(n,j))); if(l,q+=x^l)); q}

%o a(n)={my(q=CyclePoly(n,x), m=1); for(i=1,poldegree(q),if(polcoeff(q,i), m=lcm(m,i))); m} \\ _Andrew Howroyd_, Nov 11 2017

%Y Cf. A163782, A289386.

%K easy,nonn,nice

%O 1,3

%A Marie-Christine Haton (Marie-Christine.Haton(AT)loria.fr)

%E Name clarified by _Andrew Howroyd_, Nov 11 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)