A163000 Count of integers x in [0,n] satisfying A000120(x) + A000120(n-x) = A000120(n) + 1.
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
Offset: 0
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.
Crossrefs
Programs
-
Maple
A163000 := proc(n) local a,x; a := 0 ; for x from 0 to n do if A000120(x)+A000120(n-x) = A000120(n)+1 then a := a+1; fi; od: a; end: seq(A163000(n),n=0..100) ; # R. J. Mathar, Jul 21 2009
-
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 *)
-
PARI
a(n) = my(z=hammingweight(n)+1); sum(x=0, n, hammingweight(x) + hammingweight(n-x) == z); \\ Michel Marcus, Jun 06 2021
Formula
a(n)=0 iff n=2^k-1, k>=0. a(n)=1 iff n=2^k, k>=1.
Extensions
Extended beyond a(22) by R. J. Mathar, Jul 21 2009
Comments