A240850 Number of partitions p of n into distinct parts including mean(p).
0, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 1, 5, 1, 1, 6, 5, 1, 6, 1, 14, 7, 1, 1, 24, 16, 1, 9, 23, 1, 58, 1, 31, 11, 1, 75, 103, 1, 1, 13, 163, 1, 202, 1, 66, 182, 1, 1, 413, 203, 246, 17, 97, 1, 550, 347, 889, 19, 1, 1, 1500, 1, 1, 1442, 982, 625, 1424, 1, 177, 23
Offset: 0
Examples
a(12) counts these 5 partitions: {12}, {7,4,1}, {6,4,2}, {6,3,2,1}, {5,4,3}.
Programs
-
Mathematica
z = 70; f[n_] := f[n] = Select[IntegerPartitions[n], Max[Length /@ Split@#] == 1 &]; Table[Count[f[n], p_ /; MemberQ[p, Mean[p]]], {n, 0, z}] (* A240850 *) Table[Count[f[n], p_ /; ! MemberQ[p, Mean[p]]], {n, 0, z}] (* A240851 *)
-
Python
from sympy.utilities.iterables import partitions def A240850(n): return sum(1 for s,p in partitions(n,size=True) if max(p.values(),default=0)==1 and not n%s and n//s in p) # Chai Wah Wu, Sep 21 2023