login
Number of even entries (A048967) minus the number of odd entries (A001316) in row n of Pascal's triangle (A007318).
6

%I #25 Aug 24 2022 12:09:48

%S -1,-2,-1,-4,1,-2,-1,-8,5,2,3,-4,5,-2,-1,-16,13,10,11,4,13,6,7,-8,17,

%T 10,11,-4,13,-2,-1,-32,29,26,27,20,29,22,23,8,33,26,27,12,29,14,15,

%U -16,41,34,35,20,37,22,23,-8,41,26,27,-4,29,-2,-1,-64,61,58,59,52,61,54,55,40,65,58,59,44,61,46,47,16,73,66,67,52,69,54

%N Number of even entries (A048967) minus the number of odd entries (A001316) in row n of Pascal's triangle (A007318).

%H Seiichi Manyama, <a href="/A064405/b064405.txt">Table of n, a(n) for n = 0..8191</a>

%F 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

%F a(2n) = a(n) + n, a(2n+1) = 2a(n). - _Ralf Stephan_, Mar 05 2004

%F a(n) = -Sum_{k=0..n} moebius(binomial(n, k) mod 2). - _Paul Barry_, Apr 29 2005

%F a(2^n-1) = -2^n. - _Seiichi Manyama_, Aug 24 2022

%t Table[ n + 1 - 2Sum[ Mod[ Binomial[ n, k ], 2 ], {k, 0, n} ], {n, 0, 100} ]

%o (PARI) a(n)=sum(i=0,n,(-1)^binomial(n,i))

%o (PARI) a(n)=if(n<1,-1,if(n%2==0,a(n/2)+n/2,2*a((n-1)/2)))

%Y Cf. A000079, A001316, A007318, A048967.

%K easy,sign,look

%O 0,2

%A _Robert G. Wilson v_, Sep 29 2001