OFFSET
1,7
COMMENTS
Goldbach conjectured that every integer >5 is the sum of three primes. 6=2+2+2, 7=2+2+3, 8=2+3+3, 9=3+3+3=2+2+5,......
The largest possible value of a(n) is PrimePi(n)-1, which is frequently attained. - T. D. Noe, May 05 2008
LINKS
T. D. Noe, Table of n, a(n) for n = 1..2000
FORMULA
If n is of the form 2*(prime + 1) then a(n) is an even number.
EXAMPLE
For n=9: 9 = 3+3+3 = 2+2+5, we can see 3 different primes. so a(9) = 3.
MATHEMATICA
a[n_] := Select[ Reverse /@ IntegerPartitions[n, {3}] , LessEqual @@ # && PrimeQ[#[[1]]] && PrimeQ[#[[2]]] && PrimeQ[#[[3]]] &] // Flatten // Union // Length; Table[a[n], {n, 1, 85}] (* Jean-François Alcover, Oct 03 2012 *)
PROG
(PARI) a(n)=my(v=List()); forprime(r=(n+2)\3, n-4, forprime(q=(n-r+1)\2, n-r-2, if(isprime(n-r-q), listput(v, r); listput(v, q); listput(v, n-r-q)))); #vecsort(Vec(v), , 8) \\ Charles R Greathouse IV, Jul 14 2013
CROSSREFS
KEYWORD
easy,nonn,nice
AUTHOR
Naohiro Nomoto, Mar 10 2001
STATUS
approved