OFFSET
1,3
COMMENTS
If prime(k) is in A023219, a(k) = 5*prime(k)+6.
LINKS
Robert Israel, Table of n, a(n) for n = 1..2000
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
KEYWORD
nonn,look
AUTHOR
Robert Israel, Jan 07 2021
STATUS
approved