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.

A236524 Numbers n such that n^3 - n +/- 1 are twin primes.

Original entry on oeis.org

2, 4, 11, 14, 15, 21, 31, 35, 41, 45, 111, 130, 136, 140, 155, 176, 189, 221, 230, 239, 274, 316, 406, 414, 441, 465, 466, 504, 521, 561, 570, 580, 584, 591, 686, 689, 696, 759, 834, 836, 860, 869, 904, 960, 1026, 1159, 1379, 1539, 1614, 1625, 1660
Offset: 1

Views

Author

Derek Orr, Jan 27 2014

Keywords

Examples

			561^3 - 561 + 1 (176557921) and 561^3 - 561 - 1 (176557919) are twin primes. Thus, 561 is a member of this sequence.
		

Crossrefs

Intersection of A126421 and A236477.

Programs

  • Magma
    [n: n in [1..2000] | IsPrime(n^3-n-1) and IsPrime(n^3-n+1)]; // Vincenzo Librandi, Jan 30 2018
  • Mathematica
    Select[Range[2000], PrimeQ[#^3 - # - 1] && PrimeQ[#^3 - # + 1] &] (* Vincenzo Librandi, Jan 30 2018 *)
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**4) if isprime(n**3-n-1) and isprime(n**3-n+1)}