A238628 Number of partitions p of n such that n - max(p) is a part of p.
0, 1, 1, 3, 2, 5, 3, 8, 4, 11, 5, 16, 6, 21, 7, 29, 8, 38, 9, 51, 10, 66, 11, 88, 12, 113, 13, 148, 14, 190, 15, 246, 16, 313, 17, 402, 18, 508, 19, 646, 20, 812, 21, 1023, 22, 1277, 23, 1598, 24, 1982, 25, 2461, 26, 3036, 27, 3745, 28, 4593, 29, 5633
Offset: 1
Examples
a(6) counts these partitions: 51, 42, 33, 321, 3111.
Crossrefs
Programs
-
Mathematica
Table[Count[IntegerPartitions[n], p_ /; MemberQ[p, n - Max[p]]], {n, 50}]
-
PARI
a(n) = my(res = floor(n/2)); if(!bitand(n, 1), res+=(numbpart(n/2)-1)); res
-
Python
from sympy.utilities.iterables import partitions def A238628(n): return sum(1 for p in partitions(n) if n-max(p,default=0) in p) # Chai Wah Wu, Sep 21 2023
Comments