OFFSET
0,2
FORMULA
If 2*2^m+1<n<=3*2^m+1 then a(n)=a(n-2^m) except that a(3*2^m)=a(2^m)+2; if 3*2^m+1<n<=4*2^m+1 then a(n)=2*a(n-2^m) except that a(4*2^m)=2*a(3*2^m)-6. So a(2^m)=2^(m-1)+2, a(2^m+1)=2^m, a(2^m+2)=6, a(2^m+3)=4, a(3*2^m)=2^m+4, a(3*2^m+1)=2^(m+1), a(3*2^m+2)=12, a(3*2^m+3)=8, etc. for m large enough to avoid confusion.
EXAMPLE
a(5)=4 since the values of C(5,k)-C(3,k-1) are 1-0, 5-1, 10-3, 10-3, 5-1, 1-0, i.e. 1,4,7,7,4,1 of which 4 are odd.
MATHEMATICA
Join[{1, 2}, Table[Count[Table[Binomial[n, k]-Binomial[n-2, k-1], {k, 0, n}], _?OddQ], {n, 2, 80}]] (* Harvey P. Dale, Mar 03 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Henry Bottomley, Jun 16 2002
STATUS
approved