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.

A327565 Number of transfers of marbles between two sets until the first repetition.

Original entry on oeis.org

2, 3, 4, 3, 5, 4, 4, 5, 6, 4, 5, 6, 5, 5, 6, 5, 7, 6, 5, 7, 6, 5, 7, 6, 6, 7, 6, 6, 7, 6, 6, 7, 8, 6, 7, 8, 6, 7, 8, 6, 7, 8, 6, 7, 8, 6, 7, 8, 7, 7, 8, 7, 7, 8, 7, 7, 8, 7, 7, 8, 7, 7, 8, 7, 9, 8, 7, 9, 8, 7, 9, 8, 7, 9, 8, 7, 9, 8, 7, 9
Offset: 1

Views

Author

Tristan Cam, Sep 17 2019

Keywords

Comments

There are initially n marbles in both sets. In the first turn, half of the marbles of set A are transferred to set B, rounding to the upper integer when halving. In the second turn, half of the marbles of set B are transferred back to set A, following the same rule. The game goes on back and forth until we reach a distribution already encountered.
a(n) is then the number of steps until the first repetition occurs.
First occurrence of a(n) = m > 1 in this sequence: 1, 2, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049...
Conjecture: for m > 2, the first occurrence of a(n) = m is for n = 2^(m-3) + 1.

Examples

			For n = 3, (SetA ; SetB):
(3 ; 3), ceiling(3/2)=2 marbles get transferred,
(1 ; 5), ceiling(5/2)=3 marbles get transferred,
(4 ; 2), ceiling(4/2)=2 marbles get transferred,
(2 ; 4), ceiling(4/2)=2 marbles get transferred,
(4 ; 2), this is a repetition, it took 4 steps to get there, so a(3) = 4.
For n = 9, (SetA ; SetB):
(9 ; 9), (4 ; 14), (11 ; 7), (5 ; 13), (12 ; 6), (6 ; 12), (12 ; 6) which is a repetition, so a(9) = 6.
		

Crossrefs

Cf. A094373; A327613 (three sets), A327614 (four sets).

Programs

  • PARI
    a(n)={my(v=vector(2*n+1), r=n, f=1, c=0); while(!v[1+r], v[1+r]=1; r=if(f, r-ceil(r/2), r+ceil((2*n-r)/2)); c++; f=!f); c} \\ Andrew Howroyd, Sep 17 2019

Formula

For m > 1, first occurrence of a(n) = m is for n = A094373(m-1) (conjectured).

A327613 Number of transfers of marbles between three sets until the first repetition.

Original entry on oeis.org

3, 4, 8, 6, 6, 6, 8, 9, 9, 8, 11, 9, 9, 8, 11, 13, 12, 9, 11, 13, 12, 9, 11, 13, 12, 11, 14, 13, 12, 11, 14, 13, 12, 11, 14, 13, 12, 11, 14, 16, 12, 11, 14, 16, 12, 11, 14, 13, 12, 14, 14, 13, 12, 14, 14, 16, 12, 14, 14, 16, 12, 14, 14, 16, 14, 14, 14, 16, 14, 14
Offset: 1

Views

Author

Tristan Cam, Sep 19 2019

Keywords

Comments

There are initially n marbles in each of the three sets. In the first turn, half of the marbles of set A are transferred to set B, rounding to the upper integer when halving. In the second turn, half of the marbles of set B are transferred to set C, following the same rule. The game goes on back on following the pattern (A to B), (B to C), (C to A) etc. until we reach a distribution already encountered.
a(n) is then the number of steps until the first repetition occurs.
The indexes of the maximal values are 1, 2, 3, 8, 11, 16, 27, 40, 83, 176, 179, 528, 907, 1256, 2379, 3408, ...

Examples

			For n = 2, (SetA ; SetB ; SetC):
(2 ; 2 ; 2), ceiling(2/2)=1 marble get transferred from SetA to SetB,
(1 ; 3 ; 2), ceiling(3/2)=2 marbles get transferred from SetB to SetC,
(1 ; 1 ; 4), ceiling(4/2)=2 marbles get transferred from SetC to SetA,
(3 ; 1 ; 2), ceiling(3/2)=2 marbles get transferred from SetA to SetB,
(1 ; 3 ; 2), this is a repetition, it took 4 steps to get there, so a(2) = 4.
For n = 4, (SetA ; SetB ; SetC):
(4 ; 4 ; 4), (2 ; 6 ; 4), (2 ; 3 ; 7), (6 ; 3 ; 3), (3 ; 6 ; 3), (3 ; 3 ; 6), (6 ; 3 ; 3) which is a repetition, so a(4) = 6.
		

Crossrefs

Cf. A327565 (two sets), A327614 (four sets).
Showing 1-2 of 2 results.