OFFSET

1,1

COMMENTS

Except for the first 2 terms, these numbers all end in 9. Proof: Any odd prime p>5 can have one of the following forms: 10k+1, 10k+3, 10k+7, 10k+9.

10k+1 => p(p+2)+2 ends in 5, hence not prime, so p <> form 10k+1.

10k+3 => (p+2) ends in 5, hence not prime, so p <> form 10k+3.

10k+7 => p(p+2)+2 ends in 5, hence not prime, so p <> form 10k+7.

Thus p is of the form 10k+9 as stated. Moreover, p+2 ends in 1 and p(p+2)+2 is of the form 100h+1 since (10k+9)(10k+11)+2 = 100(k^2+2k+1)+1.

Subsequence of A051507. All terms larger than 5 are congruent to 29 mod 30. - Zak Seidov

LINKS

Michael De Vlieger, Table of n, a(n) for n = 1..5000

EXAMPLE

149*151 + 2 = 22501. 149, 151, and 22501 are all prime so 149 is in the sequence.

MATHEMATICA

Select[Prime@ Range@ 3000, AllTrue[{#2, #1 #2 + 2}, PrimeQ] & @@ {#, # + 2} &] (* Michael De Vlieger, Jan 22 2018 *)

PROG

(PARI) g(n, k) = forprime(x1=3, n, x2=x1+2; if(isprime(x2), p=x1*x2+k; if(isprime(p), print1(x1", ") ) ) )

(Magma) [p: p in PrimesUpTo(25000)| IsPrime(p+2) and IsPrime(p^2+2*p+2)] // Vincenzo Librandi, Jan 29 2011

CROSSREFS

KEYWORD

easy,nonn

AUTHOR

Cino Hilliard, May 30 2005

STATUS

approved