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”).

A091960
a(1)=1, a(2n)=a(2n-1)+(a(n)mod 2), a(2n+1)=a(2n)+1.
0
1, 2, 3, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 23, 24, 25, 26, 26, 27, 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 47, 48, 49, 50, 50, 51, 51, 52, 53, 54, 55, 56
OFFSET
1,2
COMMENTS
a(4*n)=3*n iff b(2n)=0 where b(1)=1, b(2n)=(b(2n-1)+b(n)) mod 2, b(2n+1)=b(2n)+1
FORMULA
a(n) is asymptotic to 3/4*n.
PROG
(PARI) a(n)=if(n<2, 1, if(n%2, a(n-1)+1, a(n-1)+a(n/2)%2))
CROSSREFS
Sequence in context: A247983 A127036 A108789 * A162621 A180446 A095394
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Mar 13 2004
STATUS
approved