A309255 a(n) = n + 1 - Sum_{k=0..n} (Stirling1(n,k) mod 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
Keywords
Links
- Amiram Eldar, Table of n, a(n) for n = 0..10000
Programs
-
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]
-
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
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)).
Comments