|
|
|
|
0, 0, 1, 0, 1, 2, 2, 0, 1, 2, 4, 4, 2, 4, 4, 0, 1, 2, 4, 4, 4, 8, 8, 8, 2, 4, 8, 8, 4, 8, 8, 0, 1, 2, 4, 4, 4, 8, 8, 8, 4, 8, 12, 16, 8, 16, 16, 16, 2, 4, 8, 8, 8, 16, 16, 16, 4, 8, 16, 16, 8, 16, 16, 0, 1, 2, 4, 4, 4, 8, 8, 8, 4, 8, 12, 16, 8, 16, 16, 16, 4, 8, 12, 16, 12, 24, 24, 32, 8, 16, 24, 32, 16
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
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
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|