OFFSET
1,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000 (terms n=1..73 from Antti Karttunen)
EXAMPLE
From Gus Wiseman, Jul 04 2019: (Start)
The a(1) = 1 through a(9) = 5 partitions are the following. The Heinz numbers of these partitions are given by A326149.
(1) (2) (3) (4) (5) (6) (7) (8) (9)
(22) (321) (44) (63)
(422) (333)
(2222) (3321)
(4211) (33111)
(22211)
(End)
MAPLE
b:= proc(n, i, t) option remember; `if`(n=0,
`if`(t=1, 1, 0), `if`(i<1, 0, b(n, i-1, t)+
`if`(i>n, 0, b(n-i, min(i, n-i), t/igcd(i, t)))))
end:
a:= n-> `if`(isprime(n), 1, b(n$3)):
seq(a(n), n=1..70); # Alois P. Heinz, Dec 20 2017
MATHEMATICA
Table[Length[Select[IntegerPartitions[n], Divisible[Times@@#, n]&]], {n, 20}] (* Gus Wiseman, Jul 04 2019 *)
b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t == 1, 1, 0], If[i < 1, 0, b[n, i - 1, t] + If[i > n, 0, b[n - i, Min[i, n - i], t/GCD[i, t]]]]];
a[n_] := If[PrimeQ[n], 1, b[n, n, n]];
Array[a, 70] (* Jean-François Alcover, May 21 2021, after Alois P. Heinz *)
PROG
(Scheme)
;; This is a naive algorithm that scans over all partitions of each n. For fold_over_partitions_of see A000793.
(define (A057568 n) (let ((z (list 0))) (fold_over_partitions_of n 1 * (lambda (partprod) (if (zero? (modulo partprod n)) (set-car! z (+ 1 (car z)))))) (car z)))
;; Antti Karttunen, Dec 20 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Oct 04 2000
EXTENSIONS
More terms from James A. Sellers, Oct 09 2000
STATUS
approved