login
A288574
Total number of distinct primes in all representations of 2*n+1 as a sum of 3 odd primes.
3
0, 0, 0, 0, 1, 2, 4, 4, 6, 7, 9, 10, 12, 15, 17, 16, 19, 19, 23, 25, 26, 26, 28, 33, 32, 35, 43, 39, 41, 45, 45, 48, 54, 55, 52, 60, 59, 56, 75, 67, 67, 81, 74, 76, 92, 83, 85, 100, 96, 81, 106, 103, 91, 121, 108, 98, 131, 120, 116, 143, 133, 129, 151, 144, 124, 163
OFFSET
0,6
COMMENTS
That is, a representation 2n+1 = p+p+p counts as 1, as p+p+q counts as 2, and p+q+r counts as 3. If each representation is counted once, we simply get A007963.
LINKS
Indranil Ghosh (first 200 terms), Hugo Pfoertner, Table of n, a(n) for n = 0..10000
MAPLE
A288574 := proc(n)
local a, i, j, k, p, q, r, pqr ;
a := 0 ;
for i from 2 do
p := ithprime(i) ;
for j from i do
q := ithprime(j) ;
for k from j do
r := ithprime(k) ;
if p+q+r = 2*n+1 then
pqr := {p, q, r} ;
a := a+nops(pqr) ;
elif p+q+r > 2*n+1 then
break;
end if;
end do:
if p+2*q > 2*n+1 then
break;
end if;
end do:
if 3*p > 2*n+1 then
break;
end if;
end do:
return a;
end proc:
seq(A288574(n), n=0..80) ; # R. J. Mathar, Jun 29 2017
PROG
(PARI) a(n)={my(p, q, r, cnt); n=2*n+1;
forprime(p=3, n\3, forprime(q=p, (n-p)\2,
if(isprime(r=n-p-q), cnt+=if(p===q&&p==r, 1, if(p==q||q==r, 2, 3))))); cnt}
(Python)
from sympy import primerange, isprime
def a(n):
n=2*n + 1
c=0
for p in primerange(3, n//3 + 1):
for q in primerange(p, (n - p)//2 + 1):
r=n - p - q
if isprime(r): c+=1 if p==q and p==r else 2 if p==q or q==r else 3
return c
print([a(n) for n in range(66)]) # Indranil Ghosh, Jun 29 2017
CROSSREFS
A288573 appears to be an erroneous version of this sequence.
Sequence in context: A342929 A038669 A288573 * A376638 A135692 A089003
KEYWORD
nonn
AUTHOR
STATUS
approved