%I #30 May 21 2021 08:11:27
%S 1,1,1,2,1,2,1,6,5,5,1,22,1,11,23,80,1,113,1,150,85,45,1,737,226,84,
%T 809,726,1,1787,1,4261,735,260,1925,9567,1,437,1877,16402,1,14630,1,
%U 9861,33057,1152,1,102082,19393,57330,10159,30706,1,207706,47927,200652
%N Number of partitions of n where n divides the product of the parts.
%H Alois P. Heinz, <a href="/A057568/b057568.txt">Table of n, a(n) for n = 1..1000</a> (terms n=1..73 from Antti Karttunen)
%e From _Gus Wiseman_, Jul 04 2019: (Start)
%e The a(1) = 1 through a(9) = 5 partitions are the following. The Heinz numbers of these partitions are given by A326149.
%e (1) (2) (3) (4) (5) (6) (7) (8) (9)
%e (22) (321) (44) (63)
%e (422) (333)
%e (2222) (3321)
%e (4211) (33111)
%e (22211)
%e (End)
%p b:= proc(n, i, t) option remember; `if`(n=0,
%p `if`(t=1, 1, 0), `if`(i<1, 0, b(n, i-1, t)+
%p `if`(i>n, 0, b(n-i, min(i, n-i), t/igcd(i, t)))))
%p end:
%p a:= n-> `if`(isprime(n), 1, b(n$3)):
%p seq(a(n), n=1..70); # _Alois P. Heinz_, Dec 20 2017
%t Table[Length[Select[IntegerPartitions[n],Divisible[Times@@#,n]&]],{n,20}] (* _Gus Wiseman_, Jul 04 2019 *)
%t 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]]]]];
%t a[n_] := If[PrimeQ[n], 1, b[n, n, n]];
%t Array[a, 70] (* _Jean-François Alcover_, May 21 2021, after _Alois P. Heinz_ *)
%o (Scheme)
%o ;; This is a naive algorithm that scans over all partitions of each n. For fold_over_partitions_of see A000793.
%o (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)))
%o ;; _Antti Karttunen_, Dec 20 2017
%Y Cf. A028422, A057567, A096276, A113309, A114324, A318950, A319000, A319005, A326149, A326152.
%K nonn
%O 1,4
%A _Leroy Quet_, Oct 04 2000
%E More terms from _James A. Sellers_, Oct 09 2000