login
A340444
a(n) is the least prime of the form p*q + p*r + q*r where p is the n-th prime and q and r are primes < p, or 0 if there are none.
2
0, 0, 31, 41, 61, 71, 151, 101, 199, 151, 227, 191, 211, 311, 241, 271, 487, 311, 479, 653, 521, 401, 421, 727, 491, 823, 521, 541, 773, 571, 641, 661, 691, 701, 751, 761, 1109, 821, 2039, 1399, 1447, 911, 1543, 971, 991, 1607, 1061, 1571, 1831, 1151, 1171, 1201, 1697, 2273, 1291, 1321, 2711
OFFSET
1,3
COMMENTS
If prime(k) is in A023219, a(k) = 5*prime(k)+6.
LINKS
EXAMPLE
a(7) = 151 because prime(7) = 17, and 151 = 17*3+17*5+3*5 is the least prime of the form 17*p + 17*q + p*q.
MAPLE
f:= proc(n) local p, L, i, j, t;
p:= ithprime(n);
L:= sort([seq(seq((ithprime(i)+p)*(ithprime(j)+p)-p^2, i=1..j-1), j=2..n-1)]);
for t in L do if isprime(t) then return t fi od:
0
end proc:
A:= map(f, [$1..100]);
PROG
(Python)
from sympy import isprime, prime
def aupto(nn):
alst, plst = [0 for i in range(nn)], [prime(i+1) for i in range(nn)]
for n in range(1, nn+1):
p = plst[n-1]
t = ((p, plst[i], plst[j]) for i in range(n-2) for j in range(i+1, n-1))
for s in sorted(p*q + p*r + q*r for p, q, r in t):
if isprime(s): alst[n-1]=s; break
return alst
print(aupto(57)) # Michael S. Branicky, Jan 07 2021
CROSSREFS
Sequence in context: A088555 A040178 A089719 * A109550 A040991 A089721
KEYWORD
nonn,look
AUTHOR
Robert Israel, Jan 07 2021
STATUS
approved