OFFSET
1,2
COMMENTS
Also sum of p(n,d) over the divisors d of n, where p(n,m) is the count of partitions of n in exactly m parts. - Wouter Meeussen, Jun 07 2009
From Gus Wiseman, Sep 24 2019: (Start)
Also the number of integer partitions of n whose maximum part divides n. The Heinz numbers of these partitions are given by A326836. For example, the a(1) = 1 through a(8) = 11 partitions are:
(1) (2) (3) (4) (5) (6) (7) (8)
(11) (111) (22) (11111) (33) (1111111) (44)
(211) (222) (422)
(1111) (321) (431)
(2211) (2222)
(3111) (4211)
(21111) (22211)
(111111) (41111)
(221111)
(2111111)
(11111111)
(End)
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000 (n = 1..500 from Wouter Meeussen, n = 501..1000 from Alois P. Heinz, n = 1001..5000 from David A. Corneth)
Eric W. Weisstein, Partition Function P
Wikipedia, Integer Partition
FORMULA
a(p) = 2 for all primes p.
EXAMPLE
a(3)=2 because 3 is a prime; a(4)=4 because the five partitions of 4 are {4}, {3, 1}, {2, 2}, {2, 1, 1}, {1, 1, 1, 1}, and the number of parts in each of them divides 4 except for {2, 1, 1}.
From Gus Wiseman, Sep 24 2019: (Start)
The a(1) = 1 through a(8) = 11 partitions whose length divides their sum are the following. The Heinz numbers of these partitions are given by A316413.
(1) (2) (3) (4) (5) (6) (7) (8)
(11) (111) (22) (11111) (33) (1111111) (44)
(31) (42) (53)
(1111) (51) (62)
(222) (71)
(321) (2222)
(411) (3221)
(111111) (3311)
(4211)
(5111)
(11111111)
(End)
MATHEMATICA
Do[p = IntegerPartitions[n]; l = Length[p]; c = 0; k = 1; While[k < l + 1, If[ IntegerQ[ n/Length[ p[[k]] ]], c++ ]; k++ ]; Print[c], {n, 1, 57}, All]
p[n_, k_]:=p[n, k]=p[n-1, k-1]+p[n-k, k]; p[n_, k_]:=0/; k>n; p[n_, n_]:=1; p[n_, 0]:=0
Table[Plus @@ (p[n, # ]&/ @ Divisors[n]), {n, 36}] (* Wouter Meeussen, Jun 07 2009 *)
Table[Count[IntegerPartitions[n], q_ /; IntegerQ[Mean[q]]], {n, 50}] (*Clark Kimberling, Apr 23 2019 *)
PROG
(PARI) a(n) = {my(nb = 0); forpart(p=n, if ((vecsum(Vec(p)) % #p) == 0, nb++); ); nb; } \\ Michel Marcus, Jul 03 2018
(Python)
# uses A008284_T
from sympy import divisors
def A067538(n): return sum(A008284_T(n, d) for d in divisors(n, generator=True)) # Chai Wah Wu, Sep 21 2023
KEYWORD
easy,nonn
AUTHOR
Naohiro Nomoto, Jan 27 2002
EXTENSIONS
Extended by Robert G. Wilson v, Oct 16 2002
STATUS
approved