OFFSET
0,2
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..8191
FORMULA
a(n) = Sum_{k=0..n} (-1)^binomial(n, k); a(2^n) = 2^n-3; a(2^n+1)=2^n-6; more generally there's a sequence z(k) such that for any k>=0 and for 2^n >k, a(2^n+k) = 2^n+z(k); for k=0, 1, 2, 3, 4, 5, 6, 7, 8... z(k) = -3, -6, -5, -12, -3, -10, -9, -24, 1, ... - Benoit Cloitre, Oct 18 2002
a(2n) = a(n) + n, a(2n+1) = 2a(n). - Ralf Stephan, Mar 05 2004
a(n) = -Sum_{k=0..n} moebius(binomial(n, k) mod 2). - Paul Barry, Apr 29 2005
a(2^n-1) = -2^n. - Seiichi Manyama, Aug 24 2022
MATHEMATICA
Table[ n + 1 - 2Sum[ Mod[ Binomial[ n, k ], 2 ], {k, 0, n} ], {n, 0, 100} ]
PROG
(PARI) a(n)=sum(i=0, n, (-1)^binomial(n, i))
(PARI) a(n)=if(n<1, -1, if(n%2==0, a(n/2)+n/2, 2*a((n-1)/2)))
CROSSREFS
KEYWORD
AUTHOR
Robert G. Wilson v, Sep 29 2001
STATUS
approved