OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
n=1: 1*prime(1) + 2*prime(2) + 3*prime(3) = 1*2 + 2*3 + 3*5 = 23 prime,
n=6: 6*prime(6) + 7*prime(7) + 8*prime(8) = 6*13 + 7*17 + 8*19 = 349 prime. - Zak Seidov, Feb 18 2016
MATHEMATICA
bb={}; Do[If[PrimeQ[n Prime[n]+(n+1) Prime[n+1]+(n+2) Prime[n+2]], bb=Append[bb, n]], {n, 1, 400}]; bb
Select[Range@ 900, PrimeQ[# Prime[#] + (# + 1) Prime[# + 1] + (# + 2) Prime[# + 2]] &] (* Michael De Vlieger, Feb 05 2016 *)
PROG
(PARI) lista(nn) = {for(n=1, nn, if(ispseudoprime(n*prime(n)+(n+1)*prime(n+1)+(n+2)*prime(n+2)), print1(n, ", "))); } \\ Altug Alkan, Feb 05 2016
(Magma) [n: n in [1..1000] | IsPrime(n*NthPrime(n)+(n+1)*NthPrime(n+1)+(n+2)*NthPrime(n+2))]; // Vincenzo Librandi, Feb 06 2016
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen(): # generator of terms
m, p, q, r = 1, 2, 3, 5
while True:
t = m*p + (m+1)*q + (m+2)*r
if isprime(t): yield m
m, p, q, r = m+1, q, r, nextprime(r)
print(list(islice(agen(), 58))) # Michael S. Branicky, May 17 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, May 02 2005
STATUS
approved