login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A125688
Number of partitions of n into three distinct primes.
16
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 2, 1, 2, 2, 2, 2, 2, 2, 3, 3, 2, 3, 2, 4, 3, 4, 2, 5, 3, 5, 4, 6, 1, 6, 3, 6, 4, 6, 3, 9, 3, 8, 5, 8, 4, 11, 3, 11, 5, 10, 3, 13, 3, 13, 6, 12, 2, 14, 5, 15, 6, 13, 2, 18, 5, 17, 6, 14, 4, 21, 5, 19, 7, 17, 4, 25, 4, 20, 8, 21, 4, 26, 4, 25, 9, 22, 4
OFFSET
1,18
COMMENTS
a(A124868(n)) = 0; a(A124867(n)) > 0;
a(A125689(n)) = n and a(m) <> n for m < A125689(n).
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
Column k=3 of A219180. - Alois P. Heinz, Nov 13 2012
Sequence in context: A339221 A025851 A343911 * A230257 A060508 A029404
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, Nov 30 2006
STATUS
approved