A111503 Numbers k such that k^3 - k^2 - 1 and k^3 - k^2 + 1 are twin primes.
2, 3, 6, 13, 21, 33, 48, 58, 90, 96, 99, 100, 111, 118, 120, 121, 133, 138, 195, 204, 279, 334, 348, 366, 393, 400, 465, 525, 541, 565, 594, 721, 736, 789, 855, 859, 925, 946, 1044, 1099, 1239, 1279, 1323, 1410, 1459, 1470, 1513, 1521, 1524, 1629, 1630, 1638
Offset: 1
Keywords
Examples
2^3 - 2^2 - 1 = 3, 2^3 - 2^2 + 1 = 5, 3 and 5 are twin primes, so 2 is in the sequence.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Magma
[n: n in [0..100000] |IsPrime(n^3-n^2-1) and IsPrime(n^3-n^2+1)]; // Vincenzo Librandi, Nov 13 2010
-
Mathematica
lst={}; Do[If[PrimeQ[n^3-n^2-1]&&PrimeQ[n^3-n^2+1], AppendTo[lst, n]], {n, 10^3}]; lst (* Vladimir Joseph Stephan Orlovsky, Aug 08 2008 *) tpQ[n_]:=Module[{c=n^3-n^2},And@@PrimeQ[{c+1,c-1}]]; Select[Range[ 1700],tpQ] (* Harvey P. Dale, Aug 27 2012 *)
-
PARI
isok(n) = isprime(n^3 - n^2 - 1) && isprime(n^3 - n^2 + 1); \\ Michel Marcus, Aug 24 2016
Comments