OFFSET
0,5
LINKS
T. D. Noe, Table of n, a(n) for n = 0..1000
Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, pp. 6, 29.
Eric Weisstein's World of Mathematics, Sierpinski Sieve
FORMULA
a(0)=a(1)=0, a(2n) = 3a(n)+n(n-1)/2, a(2n+1) = 2a(n)+a(n+1)+n(n+1)/2. - Ralf Stephan, Oct 10 2003
n(n+3)/2 - A074330(n). - Ralf Stephan, Oct 10 2003
MATHEMATICA
f[n_] := n + 1 - Sum[ Mod[ Binomial[n, k], 2], {k, 0, n} ]; Table[ Sum[ f[k], {k, 0, n} ], {n, 0, 100} ]
Accumulate[Count[#, _?EvenQ]&/@Table[Binomial[n, k], {n, 0, 60}, {k, 0, n}]] (* Harvey P. Dale, Nov 26 2014 *)
PROG
(PARI) a(n)=if(n<2, 0, if(n%2==0, 3*a(n/2)+n/4*(n/2-1), 2*a((n-1)/2)+a((n+1)/2)+((n-1)/4)*((n+1)/2)))
CROSSREFS
KEYWORD
easy,nice,nonn
AUTHOR
Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de)
STATUS
approved