OFFSET
0,3
COMMENTS
Essentially first differences of A024786 (see the formula). Also, a(n) is the number of 2's in the last section of the set of partitions of n+2 (see A135010). - Omar E. Pol, Sep 10 2008
From Gus Wiseman, May 20 2024: (Start)
Also the number of integer partitions of n containing an even number of ones, ranked by A003159. The a(0) = 1 through a(8) = 15 partitions are:
() . (2) (3) (4) (5) (6) (7) (8)
(11) (22) (32) (33) (43) (44)
(211) (311) (42) (52) (53)
(1111) (222) (322) (62)
(411) (511) (332)
(2211) (3211) (422)
(21111) (31111) (611)
(111111) (2222)
(3311)
(4211)
(22211)
(41111)
(221111)
(2111111)
(11111111)
Also the number of integer partitions of n + 1 containing an odd number of ones, ranked by A036554.
(End)
LINKS
Vaclav Kotesovec, Table of n, a(n) for n = 0..10000
FORMULA
G.f.: 1/(1+x)*1/Product_{k>0} (1-x^k).
a(n) = 1/n*Sum_{k=1..n} (sigma(k)+(-1)^k)*a(n-k).
a(n) ~ exp(Pi*sqrt(2*n/3)) / (8*sqrt(3)*n) * (1 + (11*Pi/(24*sqrt(6)) - sqrt(3/2)/Pi)/sqrt(n) - (11/16 + (23*Pi^2)/6912)/n). - Vaclav Kotesovec, Nov 05 2016
Alternating partial sums of A000041. - Gus Wiseman, May 20 2024
MATHEMATICA
Table[Sum[(-1)^(n-k)*PartitionsP[k], {k, 0, n}], {n, 0, 50}] (* Vaclav Kotesovec, Aug 16 2015 *)
(* more efficient program *) sig = 1; su = 1; Flatten[{1, Table[sig = -sig; su = su + sig*PartitionsP[n]; Abs[su], {n, 1, 50}]}] (* Vaclav Kotesovec, Nov 06 2016 *)
Table[Length[Select[IntegerPartitions[n], EvenQ[Count[#, 1]]&]], {n, 0, 30}] (* Gus Wiseman, May 20 2024 *)
PROG
(Python)
from sympy import npartitions
def A087787(n): return sum(-npartitions(k) if n-k&1 else npartitions(k) for k in range(n+1)) # Chai Wah Wu, Oct 25 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladeta Jovovic, Oct 07 2003
STATUS
approved