A341946 Number of partitions of n into 3 primes (counting 1 as a prime).
1, 1, 2, 2, 3, 2, 4, 2, 4, 2, 4, 2, 6, 3, 6, 2, 6, 3, 8, 3, 8, 3, 9, 4, 10, 3, 9, 2, 10, 4, 12, 3, 12, 4, 13, 4, 13, 3, 14, 3, 15, 5, 16, 4, 17, 4, 18, 6, 19, 4, 19, 3, 20, 6, 20, 3, 20, 4, 23, 7, 23, 4, 26, 5, 26, 6, 23, 3, 27, 5, 28, 7, 28, 6, 33, 5, 31, 7, 30, 5, 34
Offset: 3
Links
- Alois P. Heinz, Table of n, a(n) for n = 3..10000
Programs
-
Maple
b:= proc(n, i) option remember; series(`if`(n=0, 1, `if`(i<0, 0, (p-> `if`(p>n, 0, x*b(n-p, i)))( `if`(i=0, 1, ithprime(i)))+b(n, i-1))), x, 4) end: a:= n-> coeff(b(n, numtheory[pi](n)), x, 3): seq(a(n), n=3..83); # Alois P. Heinz, Feb 24 2021
-
Mathematica
b[n_, i_] := b[n, i] = Series[If[n == 0, 1, If[i < 0, 0, Function[p, If[p > n, 0, x*b[n - p, i]]][ If[i == 0, 1, Prime[i]]] + b[n, i-1]]], {x, 0, 4}]; a[n_] := Coefficient[b[n, PrimePi[n]], x, 3]; Table[a[n], {n, 3, 83}] (* Jean-François Alcover, Feb 14 2022, after Alois P. Heinz *)