OFFSET
1,18
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 1000 terms from Reinhard Zumkeller)
FORMULA
From Alois P. Heinz, Nov 22 2012: (Start)
G.f.: Sum_{0<i_1<i_2<i_3} x^(Sum_{j=1..3} prime(i_j)).
a(n) = [x^n*y^3] Product_{i>=1} (1+x^prime(i)*y). (End)
a(n) = Sum_{k=1..floor((n-1)/3)} Sum_{i=k+1..floor((n-k-1)/2)} A010051(i) * A010051(k) * A010051(n-i-k). - Wesley Ivan Hurt, Mar 29 2019
EXAMPLE
a(42) = #{2+3+37, 2+11+29, 2+17+23} = 3.
MAPLE
b:= proc(n, i) option remember; `if`(n=0, [1, 0$3], `if`(i<1, [0$4],
zip((x, y)->x+y, b(n, i-1), [0, `if`(ithprime(i)>n, [0$3],
b(n-ithprime(i), i-1)[1..3])[]], 0)))
end:
a:= n-> b(n, numtheory[pi](n))[4]:
seq(a(n), n=1..100); # Alois P. Heinz, Nov 15 2012
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, {1, 0, 0, 0}, If[i<1, {0, 0, 0, 0}, Plus @@ PadRight[{b[n, i-1], Join[{0}, If[Prime[i]>n, {0, 0, 0}, Take[b[n-Prime[i], i-1], 3]]]}]]]; a[n_] := b[n, PrimePi[n]][[4]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 30 2014, after Alois P. Heinz *)
dp3Q[{a_, b_, c_}]:=Length[Union[{a, b, c}]]==3&&AllTrue[{a, b, c}, PrimeQ]; Table[ Count[IntegerPartitions[n, {3}], _?dp3Q], {n, 100}] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 30 2019 *)
PROG
(PARI) a(n)=my(s); forprime(p=n\3, n-4, forprime(q=(n-p)\2+1, min(n-p, p-1), if(isprime(n-p-q), s++))); s \\ Charles R Greathouse IV, Aug 27 2012
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, Nov 30 2006
STATUS
approved