[go: up one dir, main page]

login
Numbers k such that k + 2, k^2 + 2, k^3 + 2, k^4 + 2 and k^5 + 2 are all prime.
1

%I #24 Dec 25 2022 05:34:12

%S 1,909,11925,358875,959595,1047585,3673089,3925635,3973971,4995825,

%T 5519241,6516015,6832245,7217805,7422381,9145809,10929765,11038071,

%U 11477235,11721291,12015555,12262791,12280935,13454349,13508475,14625849,15320829,15321489,15332745

%N Numbers k such that k + 2, k^2 + 2, k^3 + 2, k^4 + 2 and k^5 + 2 are all prime.

%C k^6 + 2 is also prime for k = 4995825, 11038071, ...

%C a(2) = 909 = A245510(6); a(10) = 4996825, the first k such that k^6 + 2 is also prime, is A245510(7). - _Jon E. Schoenfield_, Dec 24 2022

%F a(n) == 3 (mod 6) for n>1. - _Alexandru Petrescu_, Dec 24 2022

%t Select[Range[16000000], And@@PrimeQ/@(Table[n^i+2, {i, 1, 5}]/.n->#)&]

%t Select[Range[16*10^6], AllTrue[2 + #^Range[5], PrimeQ] &] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Jun 24 2015 *)

%o (Python)

%o from sympy import isprime

%o def ok(n): return all(isprime(n**i+2) for i in range(1, 6))

%o print([k for k in range(1, 2*10**7, 2) if ok(k)]) # _Michael S. Branicky_, Dec 24 2022

%Y Cf. A245510.

%Y Intersection of A040976, A067201, A067200, A216974, and A216976.

%K nonn

%O 1,2

%A _Michel Lagneau_, Sep 20 2012