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-2 of 2 results.

A360360 Given a deck of colored cards, move the top card below the bottom-most card of the same color, with one other card between them. (If the top and bottom cards have the same color, the top card is moved to the bottom of the deck; if there is no other card of the same color, the top card is moved one step down in the deck.) a(n) is the maximum, over all initial color configurations of a deck of n cards, of the length of the eventual cycle when repeatedly applying this move.

Original entry on oeis.org

1, 2, 2, 2, 4, 4, 8, 8, 16, 16, 32, 32, 64, 64
Offset: 1

Views

Author

Pontus von Brömssen, Feb 04 2023

Keywords

Comments

Cards of the same color are considered identical. There can be any number of different colors.
Apparently the lengths of all cycles (not just the longest) are powers of 2.

Examples

			For n = 7, the initial configuration 0120323 (with the top of the deck to the left) leads to a cycle of length 8: 0120323 -> 1203023 -> 2103023 -> 1030232 -> 0130232 -> 1302032 -> 3102032 -> 1020323 -> 0120323. This is the maximum for 7 cards, so a(7) = 8.
		

Crossrefs

Formula

It appears that a(n) = 2^floor((n-1)/2) for n != 2.

A360362 Maximum number of moves required to reach an already visited color configuration, when applying the move described in A360360 to a deck of n colored cards.

Original entry on oeis.org

1, 2, 3, 6, 9, 13, 20, 30, 46, 74, 106, 152, 242, 318
Offset: 1

Views

Author

Pontus von Brömssen, Feb 04 2023

Keywords

Examples

			For n = 5, the initial configuration 01102 (with the top of the deck to the left) requires 9 moves to reach an already visited configuration: 01102 -> 11020 -> 10120 -> 01210 -> 12100 -> 21010 -> 12010 -> 20101 -> 02101 -> 21010. This is the maximum for 5 cards, so a(5) = 9.
Lexicographically first optimal initial configuration for 1 <= n <= 14:
   n  a(n)  configuration
   1    1   0
   2    2   01
   3    3   001
   4    6   0012
   5    9   01102
   6   13   010012
   7   20   0111023
   8   30   01232213
   9   46   012110234
  10   74   0111234234
  11  106   01112343324
  12  152   011102345345
  13  242   0122112345345
  14  318   01112345326546
		

Crossrefs

Formula

a(n) = A357619(n) for 1 <= n <= 8, but it seems unlikely that this holds for all n.
a(n) <= A360360(n) + A360361(n). Equality holds (i.e., the maximum period and the maximum preperiod can be obtained with the same initial configuration) for n = 1, 2, 3, 4, 10, 12, 14, ... .
Showing 1-2 of 2 results.