login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A091959
a(1)=1, a(2n)=(a(n)+1) mod 2, a(2n+1)=2*a(2n)+1.
0
1, 0, 1, 1, 3, 0, 1, 0, 1, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 0, 1, 0, 1, 1, 3, 0, 1, 0, 1, 0, 1, 1, 3, 0, 1, 0, 1, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 0, 1, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 0, 1, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 0, 1, 0, 1, 1, 3, 0, 1, 0, 1, 0, 1, 1, 3, 0, 1, 0, 1
OFFSET
0,5
COMMENTS
If we replace 3's by 1's we get A035263.
FORMULA
a(A036554(n))=0; a(2*A036554(n)+1)=3 otherwise a(n)=1
PROG
(PARI) a(n)=if(n<2, 1, if(n%2, 2*a(n-1)+1, (a(n/2)+1)%2))
CROSSREFS
Sequence in context: A140807 A232629 A340007 * A318659 A318513 A354058
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Mar 13 2004
STATUS
approved