OFFSET
1,4
LINKS
Robert Israel, Table of n, a(n) for n = 1..2000
EXAMPLE
a(5)=5 as A000040(5)=11 and there are no more representations not containing 11 than 11 = (3+7+23)/3 = (3+13+17)/3 = (5+5+23)/3 = (7+7+19)/3 = (7+13+13)/3.
MAPLE
N:= 300: # to get the first A000720(N) terms
P:= select(isprime, [seq(i, i=3..3*N, 2)]):
nP:= nops(P):
V:= Vector(N):
for i from 1 to nP do
for j from i to nP do
for k from j to nP while P[i]+P[j]+P[k] <= 3*N do
r:= (P[i]+P[j]+P[k])/3;
if r::integer and isprime(r) and r <> P[j] and r <= N then V[r]:= V[r]+1 fi
od od od:
seq(V[ithprime(i)], i=1..numtheory:-pi(N)); # Robert Israel, Aug 09 2018
MATHEMATICA
M = 300; (* to get the first A000720(M) *)
P = Select[Range[3, 3*M, 2], PrimeQ]; nP = Length[P]; V = Table[0, {M}];
For[i = 1, i <= nP, i++,
For[j = i, j <= nP, j++,
For[k = j, k <= nP && P[[i]] + P[[j]] + P[[k]] <= 3*M , k++, r = (P[[i]] + P[[j]] + P[[k]])/3; If[IntegerQ[r] && PrimeQ[r] && r != P[[j]] && r <= M, V[[r]] = V[[r]]+1]
]]];
Table[V[[Prime[i]]], {i, 1, PrimePi[M]}] (* Jean-François Alcover, Mar 09 2019, after Robert Israel *)
PROG
(Haskell)
a071704 n = z (us ++ vs) 0 (3 * q) where
z _ 3 m = fromEnum (m == 0)
z ps'@(p:ps) i m = if m < p then 0 else z ps' (i+1) (m - p) + z ps i m
(us, _:vs) = span (< q) a065091_list; q = a000040 n
-- Reinhard Zumkeller, May 24 2015
(PARI) a(n, p=prime(n))=my(s=0); forprime(q=p+2, 3*p-4, my(t=3*p-q); forprime(r=max(t-q, 3), (3*p-q)\2, if(t!=p+r && isprime(t-r), s++))); s \\ Charles R Greathouse IV, Jun 04 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jun 03 2002
EXTENSIONS
Definition corrected by Zak Seidov, May 24 2015
STATUS
approved