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!)
A035491 Relevant part of deck in Guy's shuffling problem (A035485): row n of the table lists the first 2n "cards" (numbers) after the n-th shuffle. 6
2, 1, 3, 2, 4, 1, 1, 3, 5, 2, 6, 4, 6, 1, 4, 3, 7, 5, 8, 2, 5, 6, 8, 1, 2, 4, 9, 3, 10, 7, 9, 5, 3, 6, 10, 8, 7, 1, 11, 2, 12, 4, 1, 9, 11, 5, 2, 3, 12, 6, 4, 10, 13, 8, 14, 7, 4, 1, 10, 9, 13, 11, 8, 5, 14, 2, 7, 3, 15, 12, 16, 6, 2, 4, 7, 1, 3, 10, 15, 9, 12, 13, 16, 11, 6, 8, 17, 5, 18, 14 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
REFERENCES
D. Gale, Mathematical Entertainments: "Careful Card-Shuffling and Cutting Can Create Chaos," The Mathematical Intelligencer, vol. 14, no. 1, 1992, pages 54-56.
D. Gale, Tracking the Automatic Ant and Other Mathematical Explorations, A Collection of Mathematical Entertainments Columns from The Mathematical Intelligencer, Springer, 1998.
LINKS
FORMULA
T[n, 2*n + 1 - 2*A027383(k)] = 2n - k for all n and k >= 0, A027383(k) <= n. - M. F. Hasler, Aug 13 2022
EXAMPLE
{}, {2, 1}, {3, 2, 4, 1}, {1, 3, 5, 2, 6, 4}, {6, 1, 4, 3, 7, 5, 8, 2}, ...
From M. F. Hasler, Aug 11 2022: (Start)
The first rows of the table are: (sequence = right part of the following table)
row | first 2n cards (followed in the deck by 2n+1, 2n+2, ...)
------+---------------------------------------------------------
0 | - (followed by 1, 2, 3, ...)
1 | 2 1 (followed by 3, 4, 5, ...)
2 | 3 2 4 1 (followed by 5, 6, 7, ...)
3 | 1 3 5 2 6 4 (followed by 7, 8, 9, ...)
4 | 6 1 4 3 7 5 8 2 (followed by 9, 10, 11, ...)
5 | 5 6 8 1 2 4 9 3 10 7 (followed by 11, 12, 13, ...)
6 | 9 5 3 6 10 8 7 1 11 2 12 4 (followed by 13, 14, 15, ...)
7 | 1 9 11 5 2 3 12 6 4 10 13 8 14 7 (followed by 15, 16, 17, ...)
8 | 4 1 10 9 13 11 8 5 14 2 7 3 15 12 16 6 (followed by 17, 18, 19, ...)
(...)
The largest numbers in row n are 2n - k, located at column 2n + 1 - d(k) with d(k) = 2*A027383(k) = A347789(k+2) = 2, 4, 8, 12, 20, 28, ..., for k >= 0, d(k) <= 2n. (End)
MATHEMATICA
Flatten[NestList[riguy, {}, 12]] (* See A035490. *)
PROG
(PARI) A35491=Map(); d=[]; A035491_row(n)={while(#d<n*2, mapput(A35491, #d\2+1, d=[if(#d < i = i\2+i%2*(#d\2+2), i, d[i])|i<-[1..#d+2]])); mapget(A35491, n)} \\ M. F. Hasler, Aug 11 2022
(Python)
from itertools import count, islice
def agen(): # generator of terms
deck = []
for n in count(1):
deck += [2*n-1, 2*n]
first, next = deck[:n], deck[n:2*n]
deck[0:2*n:2], deck[1:2*n:2] = next, first
yield from deck
print(list(islice(agen(), 90))) # Michael S. Branicky, Aug 11 2022
CROSSREFS
Sequence in context: A259974 A243561 A135550 * A318574 A277564 A363489
KEYWORD
nonn,tabf,nice
AUTHOR
STATUS
approved

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 24 19:59 EDT 2024. Contains 371963 sequences. (Running on oeis4.)