login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A125688 Number of partitions of n into three distinct primes. 16

%I #44 Nov 03 2023 16:04:27

%S 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,

%T 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,

%U 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

%N Number of partitions of n into three distinct primes.

%C a(A124868(n)) = 0; a(A124867(n)) > 0;

%C a(A125689(n)) = n and a(m) <> n for m < A125689(n).

%H Alois P. Heinz, <a href="/A125688/b125688.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Reinhard Zumkeller)

%F From _Alois P. Heinz_, Nov 22 2012: (Start)

%F G.f.: Sum_{0<i_1<i_2<i_3} x^(Sum_{j=1..3} prime(i_j)).

%F a(n) = [x^n*y^3] Product_{i>=1} (1+x^prime(i)*y). (End)

%F 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

%e a(42) = #{2+3+37, 2+11+29, 2+17+23} = 3.

%p b:= proc(n, i) option remember; `if`(n=0, [1,0$3], `if`(i<1, [0$4],

%p zip((x, y)->x+y, b(n, i-1), [0, `if`(ithprime(i)>n, [0$3],

%p b(n-ithprime(i), i-1)[1..3])[]], 0)))

%p end:

%p a:= n-> b(n, numtheory[pi](n))[4]:

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Nov 15 2012

%t 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_ *)

%t 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 *)

%o (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

%Y Column k=3 of A219180. - _Alois P. Heinz_, Nov 13 2012

%Y Cf. A010051, A068307, A124868, A125689.

%K nonn,look

%O 1,18

%A _Reinhard Zumkeller_, Nov 30 2006

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 11:39 EDT 2024. Contains 371969 sequences. (Running on oeis4.)