A341112 Number of partitions of n into 3 prime powers (including 1).
1, 1, 2, 3, 4, 4, 6, 6, 8, 8, 10, 9, 12, 10, 13, 12, 15, 13, 17, 15, 18, 15, 19, 16, 21, 17, 23, 18, 24, 19, 27, 23, 30, 24, 32, 25, 32, 26, 34, 26, 36, 26, 36, 28, 38, 28, 40, 30, 42, 32, 43, 30, 45, 32, 47, 35, 49, 30, 50, 35, 51, 36, 53, 35, 55, 37, 54, 40, 57, 36, 61, 40, 61
Offset: 3
Keywords
Crossrefs
Programs
-
Maple
q:= proc(n) option remember; nops(ifactors(n)[2])<2 end: b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+ `if`(q(i), b(n-i, min(n-i, i), t-1), 0))) end: a:= n-> b(n$2, 3): seq(a(n), n=3..75); # Alois P. Heinz, Feb 05 2021
-
Mathematica
q[n_] := q[n] = Length[FactorInteger[n]] < 2; b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] + If[q[i], b[n - i, Min[n - i, i], t - 1], 0]]]; a[n_] := b[n, n, 3]; Table[a[n], {n, 3, 75}] (* Jean-François Alcover, Feb 22 2022, after Alois P. Heinz *)