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.

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

Original entry on oeis.org

4, 10, 14, 36, 54, 64, 70, 86, 150, 174, 176, 180, 200, 306, 384, 440, 494, 650, 706, 800, 824, 924, 976, 980, 986, 1020, 1026, 1054, 1360, 1464, 1504, 1506, 1536, 1564, 1604, 1680, 1724, 1736, 2066, 2076, 2116, 2134, 2136, 2166, 2200, 2220, 2314, 2380, 2456
Offset: 1

Views

Author

Derek Orr, Mar 26 2014

Keywords

Comments

Numbers in this sequence are all even.

Examples

			3*4^3-1 = 191 is prime and 3*4^3+1 = 193 is prime. Thus, 4 is a member of this sequence.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..5000] | IsPrime(3*n^3-1) and IsPrime(3*n^3+1)]; // Vincenzo Librandi, Mar 29 2014
  • Mathematica
    Select[Range[5000], PrimeQ[3 #^3 - 1] && PrimeQ[3 #^3 + 1]&] (* Vincenzo Librandi, Mar 29 2014 *)
  • PARI
    s=[]; for(n=1, 3000, if(isprime(3*n^3-1) && isprime(3*n^3+1), s=concat(s, n))); s \\ Colin Barker, Mar 27 2014
    
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**4) if isprime(3*(n**3)+1) and isprime(3*(n**3)-1)}