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.

Showing 1-10 of 11 results. Next

A035485 Card on top of deck at n-th stage of R. K. Guy's shuffling problem.

Original entry on oeis.org

1, 2, 3, 1, 6, 5, 9, 1, 4, 2, 16, 10, 12, 14, 23, 16, 18, 20, 17, 27, 30, 33, 38, 10, 14, 37, 32, 6, 11, 19, 53, 37, 25, 21, 12, 34, 38, 8, 50, 48, 46, 14, 18, 23, 47, 53, 84, 52, 31, 49, 1, 51, 91, 61, 42, 79, 4, 29, 6, 49, 26, 23, 115, 4, 70, 93, 109, 11, 16, 19, 49, 18, 124, 97, 70, 10, 134, 111, 7, 38, 14, 79, 11, 129
Offset: 0

Views

Author

Keywords

Comments

At n-th step, pick up top n cards and interlace them with the next n.
Here is the deck after steps 0,1,2,3,4,5:
1,2,3,4,5,6,7,...
2,1,3,4,5,6,7,...
3,2,4,1,5,6,7,...
1,3,5,2,6,4,7,8,9,...
6,1,4,3,7,5,8,2,9,10,...
It is conjectured that eventually every number appears on top of the deck.
See A035491 for (the relevant part of) the deck after the n-th step. - M. F. Hasler, Aug 13 2022

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.

Crossrefs

See A035491 for the array, also A035490, A035492.

Programs

  • PARI
    A035485(n)=A035491_row(n+!n)[1]-!n \\ M. F. Hasler, Aug 13 2022
  • Python
    def aupton(terms):
      alst, deck = [1], list(range(1, 2*terms+1))
      for n in range(1, terms+1):
        first, next = deck[:n], deck[n:2*n]
        deck[0:2*n:2] = next
        deck[1:2*n:2] = first
        alst.append(deck[0])
      return alst
    print(aupton(83)) # Michael S. Branicky, Feb 01 2021
    

Formula

a(n) = A035491(n,1), i.e., the first element of the n-th row of that table, for all n > 0. - M. F. Hasler, Aug 13 2022

Extensions

More terms from Jud McCranie

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

Views

Author

Keywords

References

  • 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.

Crossrefs

Programs

  • Python
    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

Formula

Monotonic subsequence of A035493.

Extensions

More terms from Jud McCranie

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

Views

Author

Keywords

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.

Crossrefs

Programs

  • Python
    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

Extensions

Extended (and corrected) by Jud McCranie

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

Views

Author

Keywords

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.

Crossrefs

Programs

  • Mathematica
    Transpose[Position[NestList[riguy, {}, 64], 1]][[2]] (* See A035490. *)
  • Python
    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

Views

Author

David W. Wilson, Apr 22 2001

Keywords

Comments

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.

References

  • See A035490 for references, links and programs.

Crossrefs

Programs

  • Python
    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

Views

Author

Keywords

Examples

			{}, {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)
		

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.

Crossrefs

Programs

  • Mathematica
    Flatten[NestList[riguy, {}, 12]] (* See A035490. *)
  • PARI
    A35491=Map(); d=[]; A035491_row(n)={while(#dM. 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

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

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

Views

Author

Jud McCranie, Oct 24 2000

Keywords

Comments

See A057984 for the number of steps for these to reach the top of the deck.

Examples

			In Guy's shuffle, 4 takes 8 shuffles to reach the top, no smaller number takes more shuffles, so 4 is in the sequence.
		

References

  • 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.

Crossrefs

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

Views

Author

Jud McCranie, Oct 24 2000

Keywords

Comments

See A057983 for the numbers that take these number of steps to reach the top of the deck. Gale gives a(12) as 21879255397 (incorrect).

Examples

			In Guy's shuffle, 4 takes 8 shuffles to reach the top, no smaller number takes more shuffles, so 8 is in the sequence.
		

References

  • 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.

Crossrefs

A060751 These numbers take a record number of steps to reach the top of the deck in Guy's shuffle (see A060750).

Original entry on oeis.org

1, 4, 7, 13, 15, 39, 43, 54, 1227, 1796, 2674, 3464, 6057, 7650, 17083
Offset: 0

Views

Author

Jud McCranie, Oct 24 2000

Keywords

Comments

See A060752 for the number of steps for these to reach the top of the deck.

References

  • See A057983 for references, links and programs.

Crossrefs

A060752 These numbers are the record number of steps for the numbers in A060751 to reach the top of the deck in Guy's shuffle (see A060750).

Original entry on oeis.org

3, 8, 78, 349, 383, 13932, 30452, 252992198, 364873753, 850627701, 914514429, 17493745212, 471008431072, 1027221839335, 14568535208344
Offset: 0

Views

Author

Jud McCranie, Oct 24 2000

Keywords

References

  • See A057984 for references, links and programs.

Crossrefs

Showing 1-10 of 11 results. Next