OFFSET
1,1
COMMENTS
Original name: Numbers n such that n remains prime through 2 iterations of the function f(x) = 3x + 4.
n, 3*n + 4, 9*n + 16 are primes. - Vincenzo Librandi, Aug 04 2010
Except for a(2) = 5, all terms are congruent to 3 or 9 (mod 10). If p == 1 (mod 10), 3p + 4 == 7 (mod 10) could be prime, but then 9p + 16 == 5 (mod 10). - Alonso del Arte, Nov 23 2018
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
3 * 3 + 4 = 11, which is prime, and 3 * 11 + 4 = 37, which is also prime, so 3 is in the sequence.
3 * 5 + 4 = 19, which is prime, and 3 * 19 + 4 = 61, which is also prime, so 5 is in the sequence.
3 * 7 + 4 = 25 = 5^2, so 7 is not in the sequence.
Although 3 * 11 + 4 = 37, which is prime, 3 * 37 = 115 = 5 * 23, so 11 is not in the sequence.
MATHEMATICA
Select[Prime[Range[800]], And@@PrimeQ[Rest[NestList[3# + 4 &, #, 2]]] &] (* Harvey P. Dale, Jan 21 2014 *)
PROG
(Magma) [n: n in [0..100000] | IsPrime(n) and IsPrime(3*n+4) and IsPrime(9*n+16)]; // Vincenzo Librandi, Aug 04 2010
(PARI) select(is(p)=isprime(3*p+4)&&isprime(9*p+16)&&isprime(p), primes([2, 5500])) \\ Defines the is() function. The select() command provides a check & illustration. isprime(p) at the end improves performance if a selection is operated on primes as here. - M. F. Hasler, Nov 23 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Better name from M. F. Hasler, Nov 23 2018
STATUS
approved