A327565 Number of transfers of marbles between two sets until the first repetition.
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
Keywords
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.
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).
Comments