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

A091860
a(1)=1, a(n)=sum(i=1,n-1,b(i)) where b(i)=0 if a(i) and a(n-i) are both even, b(i)=1 otherwise.
0
1, 1, 2, 3, 4, 4, 6, 5, 6, 6, 8, 6, 8, 8, 8, 7, 8, 8, 10, 8, 10, 10, 10, 8, 10, 10, 10, 10, 10, 10, 10, 9, 10, 10, 12, 10, 12, 12, 12, 10, 12, 12, 12, 12, 12, 12, 12, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 14, 12, 14, 14, 14, 12, 14, 14, 14, 14, 14
OFFSET
1,3
FORMULA
n>1 a(2n)=a(n)+2; if n is a power of 2, a(2n+1)=1+a(2n); if n is the sum of 2 distinct power of 2, a(2n+1)=2+a(2n); a(2n+1)=a(2n) otherwise
PROG
(PARI) an[1]=1; for(n=2, 100, an[n]=sum(i=1, n-1, max(a(i)%2, a(n-i)%2)))
CROSSREFS
Sequence in context: A008328 A298933 A365851 * A333995 A301764 A181833
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Mar 16 2004
STATUS
approved