A035490
Step at which card n appears on top of deck for first time in Guy's shuffling problem A035485.
Original entry on oeis.org
0, 1, 2, 8, 5, 4, 78, 37, 6, 11, 28, 12, 349, 13, 383, 10, 18, 16, 29, 17, 33, 210, 14, 133, 32, 60, 19, 106, 57, 20, 48, 26, 21, 35, 97, 217, 25, 22, 13932, 863, 205, 54, 30452, 306, 2591, 40, 44, 39, 49, 38, 51, 47, 30, 252992198, 2253, 101, 112, 246, 402, 119, 53, 139
Offset: 1
- 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.
-
riguy[ deck_List ] := Module[ {le=Length[ deck ]}, Flatten[ Transpose[ Reverse@ Partition[ Flatten[ {deck, le+1, le+2 } ], le/2+1 ] ] ] ]
Table[ Length[ FixedPoint[ riguy, {}, SameTest->(#2[ [ 1 ] ]=== i &) ] ]/2, {i, 2, 38} ]
-
10 input N; 20 clr time; 30 I=(N-1)\2; 40 while N>1; 50 inc I; 60 if N>I then N=2*(N-I)-1 else N+=N; 70 wend; 80 print I; time; 90 goto 10;
A035494
Order in which record high new cards appear for first time on top of deck in Guy's shuffling problem A035485.
Original entry on oeis.org
1, 2, 3, 6, 9, 16, 23, 27, 30, 33, 38, 53, 84, 91, 115, 124, 134, 157, 178, 222, 241, 267, 277, 298, 323, 368, 378, 407, 438, 450, 495, 496, 542, 546, 555, 561, 576, 581, 598, 619, 646, 665, 703, 750, 774, 782, 806, 860, 862, 864, 905, 909, 937, 976, 1005, 1052, 1056, 1121, 1152, 1197, 1241, 1269, 1316
Offset: 1
- D. Gale, Mathematical Entertainments: "Careful Card-Shuffling and Cutting Can Create Chaos," 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.
-
from itertools import count, islice
def agen(): # generator of terms
deck = []; record = 1; yield 1
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
if deck[0] > record: record = deck[0]; yield record
print(list(islice(agen(), 63))) # Michael S. Branicky, Aug 11 2022
A035493
Order in which new cards appear on top of deck in Guy's shuffling problem A035485.
Original entry on oeis.org
1, 2, 3, 6, 5, 9, 4, 16, 10, 12, 14, 23, 18, 20, 17, 27, 30, 33, 38, 37, 32, 11, 19, 53, 25, 21, 34, 8, 50, 48, 46, 47, 84, 52, 31, 49, 51, 91, 61, 42, 79, 29, 26, 115, 70, 93, 109, 124, 97, 134, 111, 7, 129, 131, 157, 107, 123, 117, 96, 94, 72, 178, 86, 35, 121
Offset: 1
- 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.
-
from itertools import count, islice
def agen(): # generator of terms
deck = []; tops = {1}; yield 1
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
if deck[0] not in tops: tops.add(deck[0]); yield deck[0]
print(list(islice(agen(), 65))) # Michael S. Branicky, Aug 11 2022
A035492
Position of card 1 after n-th shuffle in Guy's shuffling problem (A035485).
Original entry on oeis.org
1, 2, 4, 1, 2, 4, 8, 1, 2, 4, 8, 16, 7, 14, 28, 25, 17, 34, 31, 23, 5, 10, 20, 40, 31, 11, 22, 44, 31, 3, 6, 12, 24, 48, 27, 54, 35, 70, 63, 47, 13, 26, 52, 17, 34, 68, 43, 86, 75, 51, 1, 2, 4, 8, 16, 32, 64, 13, 26, 52, 104, 85, 45, 90, 51
Offset: 0
- 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.
-
Transpose[Position[NestList[riguy, {}, 64], 1]][[2]] (* See A035490. *)
-
from itertools import count, islice
def agen(): # generator of terms
deck = []; yield 1
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 deck.index(1) + 1
print(list(islice(agen(), 65))) # Michael S. Branicky, Aug 11 2022
A060750
Step at which card n appears on top of deck for first time in Guy's shuffling problem A035485.
Original entry on oeis.org
3, 1, 2, 8, 5, 4, 78, 37, 6, 11, 28, 12, 349, 13, 383, 10, 18, 16, 29, 17, 33, 210, 14, 133, 32, 60, 19, 106, 57, 20, 48, 26, 21, 35, 97, 217, 25, 22, 13932, 863, 205, 54, 30452, 306, 2591, 40, 44, 39, 49, 38, 51, 47, 30, 252992198, 2253, 101, 112, 246, 402, 119, 53, 139
Offset: 1
- See A035490 for references, links and programs.
-
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
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.
Original entry on oeis.org
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
Offset: 1
{}, {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)
- 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.
-
Flatten[NestList[riguy, {}, 12]] (* See A035490. *)
-
A35491=Map(); d=[]; A035491_row(n)={while(#dM. F. Hasler, Aug 11 2022
-
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
A057983
These numbers take a record number of steps to reach the top of the deck in Guy's shuffle (see A035485).
Original entry on oeis.org
1, 2, 3, 4, 7, 13, 15, 39, 43, 54, 1227, 1796, 2674, 3464, 6057, 7650, 17083
Offset: 0
In Guy's shuffle, 4 takes 8 shuffles to reach the top, no smaller number takes more shuffles, so 4 is in the sequence.
- D. Gale, Tracking the Automatic Ant and Other Mathematical Explorations, Springer, 1998, chapter 5.
- D. Gale, Mathematical Entertainments: "Careful Card-Shuffling and Cutting Can Create Chaos," The Mathematical Intelligencer, vol. 14, no. 1, 1992, pages 54-56.
A057984
These numbers are the record number of steps for the numbers in A057983 to reach the top of the deck in Guy's shuffle (see A035485).
Original entry on oeis.org
0, 1, 2, 8, 78, 349, 383, 13932, 30452, 252992198, 364873753, 850627701, 914514429, 17493745212, 471008431072, 1027221839335, 14568535208344
Offset: 0
In Guy's shuffle, 4 takes 8 shuffles to reach the top, no smaller number takes more shuffles, so 8 is in the sequence.
- D. Gale, Tracking the Automatic Ant and Other Mathematical Explorations, Springer, 1998, chapter 5.
- D. Gale, Mathematical Entertainments: "Careful Card-Shuffling and Cutting Can Create Chaos," The Mathematical Intelligencer, vol. 14, no. 1, 1992, pages 54-56.
A035500
Shuffles at which new cards appear on top of deck in Guy's shuffling problem A035485.
Original entry on oeis.org
0, 1, 2, 4, 5, 6, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 25, 26, 28, 29, 30, 32, 33, 35, 37, 38, 39, 40, 44, 46, 47, 48, 49, 51, 52, 53, 54, 55, 57, 60, 62, 64, 65, 66, 72, 73, 76, 77, 78, 83, 84, 85, 86, 87, 88, 89, 90, 91, 94, 95, 97, 98, 99, 101, 102, 103, 104
Offset: 1
- D. Gale, Mathematical Entertainments: "Careful Card-Shuffling and Cutting Can Create Chaos," 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.
-
from itertools import count, islice
def agen(): # generator of terms
deck = []; tops = {1}; yield 0
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
if deck[0] not in tops: tops.add(deck[0]); yield n
print(list(islice(agen(), 70))) # Michael S. Branicky, Aug 11 2022
A035501
Shuffles at which new record high cards appear on top of deck in Guy's shuffling problem A035485.
Original entry on oeis.org
0, 1, 2, 4, 6, 10, 14, 19, 20, 21, 22, 30, 46, 52, 62, 72, 76, 85, 94, 120, 126, 144, 147, 169, 174, 190, 216, 221, 241, 251, 254, 273, 281, 289, 292, 300, 301, 305, 308, 323, 338, 341, 379, 382, 399, 421, 429, 447, 448, 449, 473, 479, 490, 509, 510, 544, 561, 583, 588, 615, 632, 651, 686, 715, 726, 764
Offset: 1
- D. Gale, Mathematical Entertainments: "Careful Card-Shuffling and Cutting Can Create Chaos," 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.
-
from itertools import count, islice
def agen(): # generator of terms
deck = []; record = 1; yield 0
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
if deck[0] > record: record = deck[0]; yield n
print(list(islice(agen(), 66))) # Michael S. Branicky, Aug 11 2022
Showing 1-10 of 20 results.
Comments