login
A091953
a(1)=1, a(2n)=1+a(n)(mod 2); a(2n+1)=2*a(2n)+1.
0
1, 2, 5, 1, 3, 2, 5, 2, 5, 2, 5, 1, 3, 2, 5, 1, 3, 2, 5, 1, 3, 2, 5, 2, 5, 2, 5, 1, 3, 2, 5, 2, 5, 2, 5, 1, 3, 2, 5, 2, 5, 2, 5, 1, 3, 2, 5, 1, 3, 2, 5, 1, 3, 2, 5, 2, 5, 2, 5, 1, 3, 2, 5, 1, 3, 2, 5, 1, 3, 2, 5, 2, 5, 2, 5, 1, 3, 2, 5, 1, 3, 2, 5, 1, 3, 2, 5, 2, 5, 2, 5, 1, 3, 2, 5, 2, 5, 2, 5, 1, 3, 2, 5, 2, 5
OFFSET
1,2
COMMENTS
a(n) mod 2 = A035263(n)
FORMULA
a(A003159(n))=1; a(2*A003159(n))=2; a(4*A003159(n)+1)=3; a(2*A003159(n)+1)=5
PROG
(PARI) a(n)=if(n<2, 1, if(n%2, 2*a(n-1)+1, 1+a(n/2)%2))
CROSSREFS
Sequence in context: A201890 A341923 A146097 * A228824 A011456 A233384
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Mar 11 2004
STATUS
approved