%I #19 Feb 12 2017 18:11:55
%S 0,1,2,3,4,7,9,12,15,22,28,38,46,62,77,98,117,152,183,230,275,344,408,
%T 504,592,726,856,1038,1212,1469,1712,2048,2380,2839,3288,3901,4500,
%U 5313,6127,7193,8254,9671,11081,12909,14764,17153,19566,22658,25786,29762
%N Number of partitions of n with exactly one prime number.
%H Alois P. Heinz, <a href="/A132381/b132381.txt">Table of n, a(n) for n = 1..5000</a>
%e a(10) = #{8+2, 7+1+1+1, 6+3+1, 6+2+2, 6+2+1+1, 5+5, 5+4+1, 5+1+1+1+1+1, 4+4+2, 4+3+3, 4+3+1+1+1, 4+2+2+2, 4+2+2+1+1, 4+2+1+1+1+1, 3+3+3+1, 3+3+1+1+1+1, 3+1+1+1+1+1+1+1, 2+2+2+2+2, 2+2+2+2+1+1, 2+2+2+1+1+1+1, 2+2+1+1+1+1+1+1, 2+1+1+1+1+1+1+1+1} = 22.
%p b:= proc(n, i) option remember; local j; if n=0 then [1, 0] elif i<1
%p then [0$2] else b(n, i-1); for j to n/i do zip((x, y)->x+y, %,
%p [`if`(isprime(i), 0, NULL), b(n-i*j, i-1)[]], 0) od; %[1..2] fi
%p end:
%p a:= n-> b(n$2)[2]:
%p seq(a(n), n=1..60); # _Alois P. Heinz_, May 29 2013
%t zip = With[{m = Max[Length[#1], Length[#2]]}, PadRight[#1, m] + PadRight[#2, m]]&; b[n_, i_] := b[n, i] = Module[{j, pc}, Which[n == 0, {1, 0}, i<1, {0, 0}, True, pc = b[n, i-1]; For[j = 1, j <= n/i, j++, pc = zip[pc, Join[{If[PrimeQ[i], 0, Nothing]}, b[n-i*j, i-1]]] ]; pc[[1 ;; 2]] ]]; a[n_] := b[n, n][[2]]; Table[a[n], {n, 1, 60}] (* _Jean-François Alcover_, Feb 12 2017, after _Alois P. Heinz_ *)
%Y Cf. A002095.
%Y Column k=1 of A274517.
%K nonn
%O 1,3
%A _Reinhard Zumkeller_, Nov 10 2007