A070155 Numbers k such that k-1, k+1 and k^2+1 are prime numbers.
4, 6, 150, 180, 240, 270, 420, 570, 1290, 1320, 2310, 2550, 2730, 3360, 3390, 4260, 4650, 5850, 5880, 6360, 6780, 9000, 9240, 9630, 10530, 10890, 11970, 13680, 13830, 14010, 14550, 16230, 16650, 18060, 18120, 18540, 19140, 19380, 21600, 21840
Offset: 1
Examples
150 is a term since 149, 151 and 22501 are all primes.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Harvey P. Dale)
Crossrefs
Programs
-
Maple
select(n -> isprime(n-1) and isprime(n+1) and isprime(n^2+1), [seq(2*i,i=1..10000)]); # Robert Israel, Sep 02 2014
-
Mathematica
Do[s=n; If[PrimeQ[s-1]&&PrimeQ[s+1]&&PrimeQ[1+s^2], Print[n]], {n, 1, 1000000}] Select[Range[22000],AllTrue[{#+1,#-1,#^2+1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 19 2014 *)
-
PARI
is(k) = isprime(k-1) && isprime(k+1) && isprime(k^2+1); \\ Amiram Eldar, Apr 15 2024
Formula
For n>1, a(n)^2 = A242720(pi(a(n)-2)) - 2, where pi(n) is the prime counting function (A000720). - Vladimir Shevelev, Sep 02 2014
Comments