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.

A161173 a(n) is the order (or period) of the "Cat's" permutation applied to a list of n objects.

This page as a plain text file.
%I A161173 #17 Apr 28 2020 15:52:54
%S A161173 1,1,3,4,2,4,6,10,6,10,14,12,30,36,24,14,12,56,18,66,10,60,14,110,198,
%T A161173 126,48,133,210,78,105,18,18,110,660,396,93,552,120,616,276,345,43,
%U A161173 108,1122,204,702,1904,138,598,2310,1080,132,330
%N A161173 a(n) is the order (or period) of the "Cat's" permutation applied to a list of n objects.
%C A161173 The Cat's permutation is done as follows. Start with a packet of n cards (numbered 1 to n from top to bottom), and deal them into two piles, first to yourself (pile B), and then to a spectator (pile A), saying "Me, you," silently to yourself over and over. Pick up pile B and deal again, first to yourself, forming a new pile B, and then to the spectator, thereby adding to the existing pile A. Repeat, picking up the diminished pile B, and dealing "Me, you" as before. Eventually, just one card remains in pile B; place it on top of pile A. The sequence of the cards in pile A determines the Cat's permutation ("Me, you" said fast sounds like something a cat says).
%C A161173 Values for n = 4, 19 and 27 given in the 'period' column of the table for the Cat's deal in the Colm Mulachy link are incorrect. However, the corresponding cycle decompositions are correct. - _Andrew Howroyd_, Apr 28 2020
%H A161173 Andrew Howroyd, <a href="/A161173/b161173.txt">Table of n, a(n) for n = 1..2048</a>
%H A161173 Colm Mulcahy, <a href="http://www.maa.org/community/maa-columns/past-columns-card-colm/the-yummie-deal-and-variations">The Yummie Deal and Variations</a>, Card Colm, MAA Online, April 2009.
%e A161173 a(9) = 6, because when the Cat's permutation is applied to {1,2,3,4,5,6,7,8,9} we get {9,1,5,3,7,8,6,4,2}, which corresponds to the product of a disjoint six cycle and a three cycle, and hence has order lcm(6,3)=6.
%o A161173 (PARI)
%o A161173 P(n,i)={if(n==1, 1, if(i%2==0, n+1-i\2, P((n+1)\2, (n+1)\2-i\2)))}
%o A161173 Follow(s, f)={my(t=f(s), k=1); while(t>s, k++; t=f(t)); if(s==t, k, 0)}
%o A161173 Cycles(n)={my(L=List()); for(i=1, n, my(k=Follow(i, j->P(n, j))); if(k, listput(L,k))); vecsort(Vec(L))}
%o A161173 a(n)={lcm(Cycles(n))} \\ _Andrew Howroyd_, Apr 28 2020
%Y A161173 Cf. A161172.
%K A161173 nonn
%O A161173 1,3
%A A161173 _Colm Mulcahy_, Jun 04 2009, Jun 07 2009
%E A161173 Some terms corrected by _Andrew Howroyd_, Apr 28 2020