OFFSET
0,2
COMMENTS
Row sums of number the number triangle (A106522 mod 2).
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
MATHEMATICA
a[n_]:= (2^DigitCount[Floor[(n+2)/2], 2, 1] - 1)*(3 - (-1)^n)/2;
Table[a[n], {n, 0, 100}] (* G. C. Greubel, Aug 11 2021 *)
PROG
(Magma)
A106524:= func< n | 2^Multiplicity(Intseq(n+2, 2), 1) - 2^(n mod 2) >;
[A106524(n): n in [0..100]]; // G. C. Greubel, Aug 12 2021
(Sage)
def A000120(n): return sum(n.digits(2))
[A106524(n) for n in (0..100)] # G. C. Greubel, Aug 11 2021
(PARI) a(n) = bitneg(n%2, hammingweight(n+2)); \\ Kevin Ryde, Aug 25 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, May 06 2005
STATUS
approved