|
|
A068307
|
|
From Goldbach problem: number of decompositions of n into a sum of three primes.
|
|
52
|
|
|
0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 2, 2, 2, 1, 3, 2, 4, 2, 3, 2, 5, 2, 5, 3, 5, 3, 7, 3, 7, 2, 6, 3, 9, 2, 8, 4, 9, 4, 10, 2, 11, 3, 10, 4, 12, 3, 13, 4, 12, 5, 15, 4, 16, 3, 14, 5, 17, 3, 16, 4, 16, 6, 19, 3, 21, 5, 20, 6, 20, 2, 22, 5, 21, 6, 22, 5, 28, 5, 24, 7
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,9
|
|
COMMENTS
|
Vinogradov proved that every sufficiently large odd number is the sum of three primes. - T. D. Noe, Mar 27 2013
The two Helfgott papers show that every odd number greater than 5 is the sum of three primes (this is the Odd Goldbach Conjecture). - T. D. Noe, May 14 2013, N. J. A. Sloane, May 18 2013
|
|
LINKS
|
|
|
FORMULA
|
a(n) = [x^n y^3] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019
|
|
EXAMPLE
|
a(6) = 1 because 6 = 2+2+2,
a(9) = 2 because 9 = 2+2+5 = 3+3+3,
a(15) = 3 because 15 = 2+2+11 = 3+5+7 = 5+5+5,
a(17) = 4 because 17 = 2+2+13 = 3+3+11 = 3+7+7 = 5+5+7.
|
|
MATHEMATICA
|
f[n_] := Block[{c = 0, lmt = PrimePi@ Floor[n/2], p, q}, Do[p = Prime@ i; q = Prime@ j; r = n - p - q; If[ PrimeQ@ r && r >= p, c++ ], {i, lmt}, {j, i}]; c]; Array[f, 91] (* Robert G. Wilson v, Apr 13 2008 *)
Table[Count[IntegerPartitions[n, {3}], _?(AllTrue[#, PrimeQ]&)], {n, 50}] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 10 2019 *)
|
|
PROG
|
(PARI) a(n)=my(s); forprime(p=(n+2)\3, n-4, forprime(q=(n-p+1)\2, min(n-p-2, p), if(isprime(n-p-q), s++))); s \\ Charles R Greathouse IV, Jun 29 2017
(Python)
from sympy import isprime, primerange, floor
def a(n):
s=0
for p in primerange(((n + 2)//3), n - 3):
for q in primerange(((n - p + 1)//2), min(n - p - 2, p) + 1):
if isprime(n - p - q): s+=1
return s
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|