login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A309255
a(n) = n + 1 - Sum_{k=0..n} (Stirling1(n,k) mod 2).
2
0, 1, 1, 2, 3, 4, 3, 4, 7, 8, 7, 8, 9, 10, 7, 8, 15, 16, 15, 16, 17, 18, 15, 16, 21, 22, 19, 20, 21, 22, 15, 16, 31, 32, 31, 32, 33, 34, 31, 32, 37, 38, 35, 36, 37, 38, 31, 32, 45, 46, 43, 44, 45, 46, 39, 40, 49, 50, 43, 44, 45, 46, 31, 32, 63, 64, 63, 64, 65, 66, 63, 64, 69, 70, 67, 68, 69
OFFSET
0,4
COMMENTS
Number of even entries in n-th row of triangle of Stirling numbers of the first kind (A048994).
LINKS
FORMULA
G.f.: 1/(1 - x)^2 - (1 + x) * Product_{k>=0} (1 + 2*x^(2^(k+1))).
a(n) = n + 1 - 2^A000120(floor(n/2)).
MATHEMATICA
Table[n + 1 - Sum[Mod[StirlingS1[n, k], 2], {k, 0, n}], {n, 0, 76}]
nmax = 76; CoefficientList[Series[1/(1 - x)^2 - (1 + x) Product[(1 + 2 x^(2^(k + 1))), {k, 0, Floor[Log[2, nmax]] + 1}], {x, 0, nmax}], x]
PROG
(PARI) a(n) = n + 1 - sum(k=0, n, stirling(n, k, 1) % 2); \\ Michel Marcus, Jul 19 2019
(PARI) a(n) = n + 1 - 2^hammingweight(n\2); \\ Amiram Eldar, Jul 25 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Jul 19 2019
STATUS
approved