OFFSET
1,1
COMMENTS
Except for the first term, these numbers end in 9. p can take one of the forms 10k+1, 10k+3, 10k+7 or 10k+9. p = 10k+1 => p*(p+2)+6 = (10k+1)(10k+3)+6 = 10h+9. p can be 10k+1. p = 10k+3 => p+2 = 0 mod 5 not prime. p cannot be 10k+3. p = 10k+7 => p(p+2)+6 = (10k+7)(10k+9)+6 = 10h+9. p can be 10k+7. p = 10k+9 => p(p+2)+6 = (10k+9)*(10k+11)+6 = 0 mod 5 not prime. p cannot be 10k+9. Thus by exhaustion p(p+2)+6 ends in 9.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
149 = 11*13 + 6 is a term since 11, 13 and 149 are primes.
MATHEMATICA
f[p_] := p*(p + 2) + 6; f /@ Select[Range[10^4], And @@ PrimeQ[{#, # + 2, f[#]}] &] (* Amiram Eldar, Mar 26 2021 *)
Select[Times@@#+6&/@Select[Partition[Prime[Range[1000]], 2, 1], #[[2]]-#[[1]]==2&], PrimeQ] (* Harvey P. Dale, Aug 16 2024 *)
PROG
(PARI) g(n, k=6) = forprime(x1=3, n, x2=x1+2; if(isprime(x2), p=x1*x2+k; if(isprime(p), print1(p, ", ") ) ) )
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, May 31 2005
STATUS
approved