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”).

A087787
a(n) = Sum_{k=0..n} (-1)^(n-k)*A000041(k).
16
1, 0, 2, 1, 4, 3, 8, 7, 15, 15, 27, 29, 48, 53, 82, 94, 137, 160, 225, 265, 362, 430, 572, 683, 892, 1066, 1370, 1640, 2078, 2487, 3117, 3725, 4624, 5519, 6791, 8092, 9885, 11752, 14263, 16922, 20416, 24167, 29007, 34254, 40921, 48213, 57345, 67409
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
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) = A024786(n+2)-A024786(n+1). - Omar E. Pol, Sep 10 2008
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
a(n) = A000041(n) - a(n-1). - Jon Maiga, Aug 29 2019
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
The unsigned version is A000070, strict A036469.
For powers of 2 instead number of partitions we have A001045.
The strict or odd version is A025147 or A096765.
The ordered version (compositions instead of partitions) is A078008.
For powers of 2 instead of -1 we have A259401, cf. A259400.
A002865 counts partitions with no ones, column k=0 of A116598.
A072233 counts partitions by sum and length.
Sequence in context: A076077 A152194 A268630 * A182712 A100818 A005291
KEYWORD
nonn
AUTHOR
Vladeta Jovovic, Oct 07 2003
STATUS
approved