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

A381114 Triangle read by rows: T(n,k) is the number of the k-th eliminated person in a variation of the Josephus elimination process for n people, where the number of people skipped is equal to the number of letters in the previous number's English name.

Original entry on oeis.org

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

Views

Author

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

Keywords

Comments

In this variation of the Josephus elimination process, people numbered 1 through n are arranged in a circle. A pointer starts at person 1. Person 1 is eliminated, then three people are skipped because the number O-N-E has three letters. Then, the next person is eliminated. Next, three people are skipped because T-W-O has three letters, and the next person is eliminated. Then, five people are skipped because T-H-R-E-E has five letters, and so on. This repeats until no people remain. This sequence represents the triangle T(n, k), the order of elimination for the person numbered k in a circle of n people.
Every entry of the first column is 1.
In rows 5 and after, the second number is 5. In rows 9 and after, the third number is 9. In rows 15 and after, the fourth number is 15. In the limit, the numbers in a row form sequence A381128(k).

Examples

			Triangle begins:
 1;
 1, 2;
 1, 3, 2;
 1, 2, 4, 3;
 1, 5, 2, 4, 3;
 1, 5, 4, 3, 6, 2;
 1, 5, 3, 6, 2, 4, 7;
 ...
For n = 4, suppose four people are arranged in a circle. The first person is eliminated, then three people are skipped because O-N-E has three letters. The leftover people are now in order 2,3,4. Then, the next person (numbered 2) is eliminated. The leftover people are now ordered 3,4. The next three people are skipped, so the person eliminated is number 4. Then, 5 people are skipped, and the next person eliminated is number 3. Thus, the fourth row of the triangle is 1,2,4,3.
		

Crossrefs

Programs

  • Python
    from num2words import num2words as n2w
    def f(n): return sum(1 for c in n2w(n).replace(" and", "") if c.isalpha())
    def row(n):
        c, i, J, out = 1, 0, list(range(1, n+1)), []
        while len(J) > 1:
            q = J.pop(i)
            out.append(q)
            i = (i + f(c))%len(J)
            c = c+1
        return out + [J[0]]
    print([e for n in range(1, 14) for e in row(n)]) # Michael S. Branicky, Feb 16 2025

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.

A381129 A version of the Josephus problem: a(n) is the surviving integer under the spelling version of the elimination process, called Down-SpellUnder.

Original entry on oeis.org

1, 2, 2, 3, 3, 2, 7, 8, 4, 6, 4, 6, 7, 11, 10, 3, 14, 4, 17, 11, 3, 16, 7, 16, 7, 22, 2, 8, 24, 27, 7, 21, 13, 28, 30, 8, 3, 37, 12, 7, 8, 33, 7, 33, 44, 11, 32, 8, 6, 43, 2, 18, 49, 8, 32, 54, 26, 43, 44, 30, 40, 52, 26, 44, 8, 27, 60, 16, 11, 61, 70, 14, 58, 55
Offset: 1

Views

Author

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

Keywords

Comments

Arrange n people numbered 1, 2, 3, ..., n in a circle, increasing clockwise. Execute the person numbered 1, then spell the letters of O-N-E, moving one person clockwise for each letter. Once you are done, eliminate the next person. Then, spell the letters of T-W-O; in other words, skip three people and eliminate the next person. Following this, spell the letters of T-H-R-E-E; in other words, skip five people and eliminate the next person. Continue until one person remains. The number of this person is a(n).

Examples

			Consider n = 4 people. The first person eliminated is number 1. This leaves the remaining people in the order 2, 3, 4. The second person eliminated is number 2; the people left are in the order 3, 4. The next person eliminated is numbered 4, leaving only the person numbered 3. Thus, a(4) = 3.
		

Crossrefs

Programs

  • Python
    from num2words import num2words as n2w
    def f(n): return sum(1 for c in n2w(n).replace(" and", "") if c.isalpha())
    def a(n):
        c, i, J = 1, 0, list(range(1, n+1))
        while len(J) > 1:
            q = J.pop(i)
            i = (i + f(c))%len(J)
            c = c+1
        return J[0]
    print([a(n) for n in range(1, 75)]) # Michael S. Branicky, Feb 16 2025

Extensions

a(22) and beyond from Michael S. Branicky, Feb 16 2025
Showing 1-3 of 3 results.