cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A111503 Numbers k such that k^3 - k^2 - 1 and k^3 - k^2 + 1 are twin primes.

Original entry on oeis.org

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

Views

Author

Pierre CAMI, Nov 16 2005

Keywords

Comments

Intersection of A111501 and A162293. - Ivan Neretin, Aug 24 2016

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.
		

Crossrefs

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