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

A344792 a(n) is half the n-th term of a truncated sesquinary (base 3/2) tree.

Original entry on oeis.org

1, 4, 2, 6, 10, 3, 13, 9, 22, 15, 121, 7, 5, 67, 20, 31, 14, 33, 76, 34, 23, 409, 182, 16, 11, 40, 8, 151, 101, 30, 46, 70, 47, 21, 49, 112, 50, 114, 172, 51, 175, 52, 35, 1381, 614, 273, 616, 24, 37, 25, 17, 60, 91, 12, 19, 340, 227, 769, 152, 45, 103, 69, 157
Offset: 1

Views

Author

John-Vincent Saddic, May 28 2021

Keywords

Comments

The tree is created by planting a tree with alternating branching and nonbranching nodes (as described in A005428). The nodes are then labeled in order -- 1,2,3,4,... All odd nodes are removed, leaving an infinite binary tree of every even number. Finally, each node is divided by two. The first four rows of the resultant tree are as follows:
1
4 2
6 10 3 13
9 22 15 121 7 5 67 20
...
The first number of the n-th row, a(2^(n-1)), is A081614(n). The last number of the n-th row is A182459(n). The lowest number of the n-th row is A061419(n). It appears that when n is even, A189706(a(n)+1) = 0, and when n is odd A189706(a(n)+1) = 1. This is true for at least the first n = 1 through 40000.

Crossrefs

Programs

  • Java
    See Links.
    
  • Maple
    a:= proc(n) option remember;
          a(iquo(n, 2))*3 + irem(n, 2);
          while %::odd do ceil(% * 3/2) od; %/2
        end: a(1):=1:
    seq(a(n), n=1..63);  # Alois P. Heinz, May 29 2021
  • Mathematica
    a[n_] := a[n] = Module[{t}, t = a[Quotient[n, 2]]*3 + Mod[n, 2];
         While[OddQ[t], t = Ceiling[t * 3/2] ]; t/2]; a[1] = 1;
    Table[a[n], {n, 1, 63}] (* Jean-François Alcover, Apr 14 2022, after Alois P. Heinz *)
  • PARI
    a(n) = my(t=1); forstep(i=logint(n,2)-1,0,-1, t=3*t+1+bittest(n,i); my(k=valuation(t,2)); t=(t*3^k)>>(k+1)); t; \\ Kevin Ryde, May 29 2021

A385333 The numbers of people such that, in the variant of the Josephus problem in which three people are skipped and then one is eliminated, the last person is the last to be eliminated.

Original entry on oeis.org

1, 21, 38, 51, 122, 163, 689, 919, 2906, 3875, 5167, 51617, 68823, 163137, 290022, 1629537, 6866858, 9155811, 16276998, 28936886, 38582515, 121939802, 162586403, 216781871, 289042495, 513853325, 685137767, 913517023, 2165373685, 12166489185, 38452113969, 121527668842
Offset: 1

Views

Author

Tanya Khovanova, Nathan Sheffield, and the MIT PRIMES STEP junior group, Jun 25 2025

Keywords

Comments

This sequence can be used in magic tricks with under-under-under-down dealing pattern. The deck sizes in this sequence guarantee that after the dealing, the last card dealt is the one that was initially on the bottom.

Examples

			Suppose there are 5 people in a circle. After three people are skipped, the person number 4 is eliminated. The leftover people are 5,1,2,3 in order. Then person number 3 eliminated, and the leftover people are 5,1,2 in order. Then person number 5 is eliminated, and the leftover people are 1,2 in order. Then person number 2 is eliminated, and person 1 is freed. Thus, 5 is NOT in this sequence.
		

Crossrefs

Cf. A000225 (for skip 1 take 1), A182459 (for skip 2 take 1).

Extensions

More terms from Jinyuan Wang, Jul 01 2025

A385513 The numbers of people in the "SpellUnder-Down" variant of the Josephus problem such that the last person is freed.

Original entry on oeis.org

1, 6, 7, 105, 181, 215, 821, 1907, 3176, 23388, 55058
Offset: 1

Views

Author

Tanya Khovanova, Nathan Sheffield, and the MIT PRIMES STEP junior group, Jul 01 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. In the corresponding Josephus problem, we skip the next person for each under dealing, and eliminate the next person for each down dealing.
This sequence can be used in magic tricks with the SpellUnder-Down dealing pattern. The deck sizes in this sequence guarantee that after the dealing, the last card dealt is the one that was initially on the bottom.
The classical Josephus problem corresponds to under-down dealing. In this case, the last person is freed when the number of people is a power of 2 minus 1.
A naive probabilistic argument predicts the probability that A380204(k) = k is 1/k and expects this sequence to be infinite and distributed roughly as A002387. - Michael S. Branicky, Jul 24 2025

Examples

			Suppose there are 5 people in a circle. We start with skipping three people for O-N-E. After three people are skipped, the person number 4 is eliminated. The leftover people are 5,1,2,3 in order. Then we skip three people for T-W-O. The person number 3 eliminated, and the leftover people are 5,1,2 in order. Then we skip 5 people for T-H-R-E-E, and person number 2 is eliminated, and the leftover people are 5,1 in order. Then we skip four people for F-O-U-R. person number 5 is eliminated. Person 1 is freed. As person 1 is not last, 5 is NOT in this sequence.
		

Crossrefs

Formula

{k | A380204(k) = k}. - Michael S. Branicky, Jul 24 2025

Extensions

a(10)-a(11) from Michael S. Branicky, Jul 24 2025

A386312 Numbers of people such that the last person is freed in the variant of the Josephus problem in which one person is skipped, then one is eliminated, then two people are skipped and one eliminated, then three people are skipped and so on.

Original entry on oeis.org

1, 7, 10, 12, 21, 25, 28, 235, 822, 24886, 99607, 101497, 107716, 5756103, 55480598
Offset: 1

Views

Author

Tanya Khovanova, Nathan Sheffield, and the MIT PRIMES STEP junior group, Aug 20 2025

Keywords

Comments

This sequence can also be described in terms of "AP dealing", in which one deals a deck of N cards into a new deck by moving one card to the bottom, dealing out the next card on top of the new deck, moving two cards to the bottom, etc. This sequence consists of all the deck sizes such that the bottom card of the deck moves to the top after AP dealing.
Numbers k such that A291317(k) = k.

Examples

			Suppose there are people 1,2,3,4,5,6,7 in a circle. We first skip one person and eliminate the next, leaving people in order 3,4,5,6,7,1. Now, we skip two people and eliminate the next, leaving 6,7,1,3,4. Now, we skip three and eliminate the next, leaving 4,6,7,1. Now, we skip four and eliminate the next, leaving 6,7,1. Now, we skip five and eliminate the next, leaving 6,7. Finally, we skip six and eliminate the next, leaving just 7. As the last person in the circle was freed, 7 belongs to this sequence.
		

Crossrefs

Programs

  • Python
    def F(n):
        c, i, J = 1, 0, list(range(1, n+1))
        while len(J) > 1:
            i = (i + c) % len(J)
            q = J.pop(i)
            c = c + 1
        return J[0]
    print([n for n in range(1, 100000) if F(n) == n])

Extensions

a(15) from Jinyuan Wang, Aug 31 2025
Showing 1-4 of 4 results.