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

A380201 Triangle T(n,k) read by rows, where row n is a permutation of numbers 1 through n, such that if a deck of n cards is prepared in this order, and SpellUnder-Down dealing is used, then the resulting cards are put down in increasing order.

Original entry on oeis.org

1, 2, 1, 1, 3, 2, 2, 4, 3, 1, 5, 3, 2, 1, 4, 4, 2, 5, 1, 3, 6, 2, 3, 4, 1, 6, 5, 7, 5, 6, 8, 1, 7, 4, 3, 2, 6, 5, 4, 1, 9, 3, 8, 2, 7, 4, 9, 10, 1, 3, 6, 8, 2, 5, 7, 6, 7, 3, 1, 11, 5, 8, 2, 10, 4, 9, 10, 3, 5, 1, 11, 12, 7, 2, 4, 6, 8, 9, 3, 8, 7, 1, 11, 6, 4, 2, 12, 13, 10, 9, 5, 12, 10, 6, 1, 13, 4, 9, 2, 14, 8, 11, 5
Offset: 1

Views

Author

Tanya Khovanova and the MIT PRIMES STEP junior group, Jan 16 2025

Keywords

Comments

In Spell Under-Down dealing, we spell the positive integers starting from O-N-E, moving 1 card from the top of the deck underneath the deck for each letter, followed by dealing or "putting down" the top card. So we start by putting 3 cards under for O-N-E, then we deal a card. Then we put 3 cards under for T-W-O, then we deal a card. Then we put 5 cards under for T-H-R-E-E, and subsequently deal a card. This dealing sequence is highly irregular because it depends on English spelling. The dealing pattern starts: UUUDUUUDUUUUUD, where each "U" corresponds to putting a card “under” and each "D" corresponds to dealing a card “down”.
This card dealing can be thought of as a generalized version of the Josephus problem. In this version of the Josephus problem, we spell the positive integers in increasing order, each time skipping past 1 person for each letter and executing the next person. The card in row n and column k is x if and only if in the corresponding Josephus problem with n people, the person numbered x is the k-th person eliminated.
Equivalently, each row of the corresponding Josephus triangle A380247 is an inverse permutation of the corresponding row of this triangle. The first column is A380246, the order of elimination of the first person in the corresponding Josephus problem. The index of the largest number in row n is A380204(n), corresponding to the index of the freed person in the corresponding Josephus problem. The number of card moves if we start with n cards is A380202 = A067278(n) + n.

Examples

			Triangle begins:
  1;
  2, 1;
  1, 3, 2;
  2, 4, 3, 1;
  5, 3, 2, 1, 4;
  4, 2, 5, 1, 3, 6;
  2, 3, 4, 1, 6, 5, 7;
  5, 6, 8, 1, 7, 4, 3, 2;
  ...
For n = 4 suppose there are four cards arranged in order 2, 4, 3, 1. Three cards go under for each letter in O-N-E, then 1 is dealt. Now the deck is ordered 2,4,3. Three cards go under for each letter in T-W-O, then card 2 is dealt. Now the leftover deck is ordered 4,3. Five cards go under for each letter in T-H-R-E-E, then card 3 is dealt. Finally, card 4 is dealt. The dealt cards are in numerical order. Thus, the fourth row of the triangle is 2, 4, 3, 1.
		

Crossrefs

Programs

  • Python
    from num2words import num2words as n2w
    def spell(n):
        return sum(1 for c in n2w(n).replace(" and", "").replace(" ", "").replace(",","").replace("-", ""))
    def nthRow(n):
        l = []
        for i in range(0,n):
            l.append(0)
        zp = 0
        for j in range(1,n+1):
            zc = 0
            while zc <= spell(j):
                if l[zp] == 0:
                    zc += 1
                zp += 1
                zp = zp % n
            l[zp-1] = str(j)
        return l
    l = []
    for i in range(1,20):
        l += nthRow(i)
    print(", ".join(l))

A380202 Number of card moves to deal n cards using the SpellUnder-Down dealing.

Original entry on oeis.org

4, 8, 14, 19, 24, 28, 34, 40, 45, 49, 56, 63, 72, 81, 89, 97, 107, 116, 125, 136, 146, 156, 168, 179, 190, 200, 212, 224, 235, 246, 256, 266, 278, 289, 300, 310, 322, 334, 345, 355, 364, 373, 384, 394, 404, 413, 424, 435, 445, 455, 464, 473, 484, 494, 504, 513, 524, 535, 545, 555, 564, 573, 584, 594, 604, 613, 624, 635, 645
Offset: 1

Views

Author

Tanya Khovanova and the MIT PRIMES STEP junior group, Jan 16 2025

Keywords

Comments

In SpellUnder-Down dealing, we spell the number of the next card, putting a card under for each letter in the number, then we deal the next card. So we start with putting 3 cards under, for O-N-E, then deal, then 3 under for T-W-O, then deal, then 5 under for T-H-R-E-E, then deal. The dealing sequence is highly irregular because it depends on English spelling. The dealing pattern starts: UUUDUUUDUUUUUD.

Examples

			The dealing pattern to deal three cards is UUUDUUUDUUUUUD. It contains 14 letters, thus, a(3) = 14.
		

Crossrefs

Formula

a(n) = A067278(n) + n.

A381128 The number of card moves required to deal n cards using Down-SpellUnder dealing.

Original entry on oeis.org

1, 5, 9, 15, 20, 25, 29, 35, 41, 46, 50, 57, 64, 73, 82, 90, 98, 108, 117, 126, 133, 143, 153, 165, 176, 187, 197, 209, 221, 232, 239, 249, 259, 271, 282, 293, 303, 315, 327, 338, 344, 353, 362, 373, 383, 393, 402, 413, 424, 434, 440, 449, 458, 469, 479, 489, 498, 509, 520, 530, 536, 545, 554, 565, 575, 585, 594, 605
Offset: 1

Views

Author

Tanya Khovanova, Nathan Sheffield, and the MIT PRIMES STEP junior group, Feb 14 2025

Keywords

Comments

In Down-SpellUnder dealing, after dealing the i-th card we move a card from the top of the deck to the bottom for each letter in the English spelling of i. Then we deal the next card and proceed likewise. So we start by dealing card 1, then putting 3 cards under because O-N-E has three letters. Then, we deal the next card, and put three cards under 3 because T-W-O has three letters. We then deal again, put 5 under for T-H-R-E-E, and so on. This dealing sequence is highly irregular because it depends on English spelling. The dealing pattern starts: DUUUDUUUDUUUUUD, where D means 'deal', and U means 'under'.

Examples

			The dealing pattern to deal four cards is DUUUDUUUDUUUUUD. It contains 15 letters, so a(4) = 15.
		

Crossrefs

Programs

  • Python
    from num2words import num2words as n2w
    def spell(n):
        return sum(1 for c in n2w(n).replace(" and", "").replace(" ", "").replace(",", "").replace("-", ""))
    moves_so_far = 0
    l = []
    for i in range(1, 41):
        moves_so_far += 1
        l += [str(moves_so_far)]
        moves_so_far += spell(i)
    print(", ".join(l))

Formula

a(n) = A067278(n-1) + n.

A153453 a(n) = letters(n) + a(n-1); a(0) = 0 in Spanish.

Original entry on oeis.org

0, 3, 6, 10, 16, 21, 25, 30, 34, 39, 43, 47, 51, 56, 63, 69, 78, 88, 97, 107, 113, 122, 131, 141, 153, 164, 174, 185, 195, 206, 213, 224, 235, 247, 261, 274, 286, 299, 311, 324, 332, 344, 356, 369, 384, 398, 411, 425, 438, 452, 461, 474, 487, 501, 517, 532, 546, 561, 575, 590, 597
Offset: 0

Views

Author

Rodolfo Kurchan, Dec 26 2008

Keywords

Crossrefs

Extensions

More terms from Álvar Ibeas, Sep 20 2020

A225521 Cumulative number of letters in first n English names of playing card denominations: ace, two, three, ... jack, queen, king.

Original entry on oeis.org

3, 6, 11, 15, 19, 22, 27, 32, 36, 39, 43, 48, 52
Offset: 1

Views

Author

Jonathan Vos Post, May 09 2013

Keywords

Comments

Differs from A067278 at 11th value, because, though Letters("one") = Letters("ace") = 3, Letters("eleven") != Letters("jack"). Note the nice coincidence that a(13) = 52, the number of cards in a standard deck of cards.

Examples

			a(11) = a(10) + the number of letters in "jack" = 39 + 4 = 43.
		

References

  • Brad Meltzer, Dead Even, first Warner Books printing, March 1999, p. 15.

Crossrefs

Showing 1-5 of 5 results.