OFFSET
0,6
COMMENTS
For every solution x, binomial(n,x) is 2 times an odd integer.
A generalization: for every solution 0 <= x <= n of the equation A000120(x) + A000120(n-x) = A000120(n) + r, binomial(n,x) is 2^r times an odd integer.
Apparently this is also the number of 2's in the n-th row of A034931. - R. J. Mathar, Jul 28 2017
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
Kenneth S. Davis and William A. Webb, Pascal's triangle modulo 4, Fib. Quart., 29 (1991), 79-83.
Vladimir Shevelev, Binomial predictors, arXiv:0907.3302 [math.NT], 2009.
L. Spiegelhofer and M. Wallner, Divisibility of binomial coefficients by powers of two, arXiv:1710.10884 [math.NT], 2017.
FORMULA
a(n)=0 iff n=2^k-1, k>=0. a(n)=1 iff n=2^k, k>=1.
MAPLE
MATHEMATICA
okQ[x_, n_] := DigitCount[x, 2, 1] + DigitCount[n - x, 2, 1] == DigitCount[n, 2, 1] + 1; a[n_] := Count[Range[0, n], x_ /; okQ[x, n]]; Table[a[n], {n, 0, 92}] (* Jean-François Alcover, Jul 13 2017 *)
PROG
(PARI) a(n) = my(z=hammingweight(n)+1); sum(x=0, n, hammingweight(x) + hammingweight(n-x) == z); \\ Michel Marcus, Jun 06 2021
CROSSREFS
A001316 and A163577 count binomial coefficients with 2-adic valuation 0 and 2. A275012 gives a measure of complexity of these sequences. - Eric Rowland, Mar 15 2017
KEYWORD
nonn,base
AUTHOR
Vladimir Shevelev, Jul 20 2009
EXTENSIONS
Extended beyond a(22) by R. J. Mathar, Jul 21 2009
STATUS
approved