login
a(n) = n + 1 - Sum_{k=0..n} (Stirling2(n,k) mod 2).
2

%I #12 Jul 25 2023 04:04:42

%S 0,1,1,1,2,2,2,3,5,5,4,4,6,7,7,9,12,12,10,9,11,11,10,12,16,17,15,15,

%T 18,20,20,23,27,27,24,22,24,23,21,23,28,28,24,23,27,29,28,32,38,39,35,

%U 33,36,36,34,37,43,45,42,42,46,49,49,53,58,58,54,51,53,51,48,50,56,55,49,47,52

%N a(n) = n + 1 - Sum_{k=0..n} (Stirling2(n,k) mod 2).

%C Number of even entries in n-th row of triangle of Stirling numbers of the second kind (A048993).

%H Amiram Eldar, <a href="/A309256/b309256.txt">Table of n, a(n) for n = 0..10000</a>

%F G.f.: x * (2 - x)/(1 - x)^2 - x * (1 + x) * Product_{k>=0} (1 + x^(2^k) + x^(2^(k+1))).

%F a(n) = n + 1 - A007306(n).

%t Table[n + 1 - Sum[Mod[StirlingS2[n, k], 2], {k, 0, n}], {n, 0, 76}]

%t nmax = 76; CoefficientList[Series[x (2 - x)/(1 - x)^2 - x (1 + x) Product[(1 + x^(2^k) + x^(2^(k + 1))), {k, 0, Floor[Log[2, nmax]] + 1}], {x, 0, nmax}], x]

%o (PARI) a(n) = n + 1 - sum(k=0, n, stirling(n, k, 2) % 2); \\ _Michel Marcus_, Jul 19 2019

%Y Cf. A002487, A007306, A048967, A048993, A309255.

%K nonn

%O 0,5

%A _Ilya Gutkovskiy_, Jul 19 2019