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.

A239135 Numbers k such that (k-1)*k^2 + 1 and k^2 + (k-1) are both prime.

Original entry on oeis.org

2, 3, 5, 6, 8, 13, 21, 24, 26, 28, 35, 45, 48, 50, 55, 76, 83, 89, 93, 96, 100, 101, 115, 120, 138, 140, 148, 149, 181, 191, 195, 203, 206, 209, 215, 230, 258, 259, 281, 285, 294, 301, 309, 323, 330, 349, 358, 373, 380, 386, 393, 395, 423, 428, 433, 474, 495
Offset: 1

Views

Author

Ilya Lopatin following a suggestion from Juri-Stepan Gerasimov, Mar 15 2014

Keywords

Comments

Numbers k such that (k^3 - k^2 + 1)*(k^2 + k - 1) is semiprime.
Intersection of A045546 and A111501.
Primes in this sequence: 2, 3, 5, 13, 83, 89, 101, 149, 181, 191, ...

Examples

			2 is in this sequence because (2-1)*2^2+1=5 and 2^2+(2-1)=5 are both prime.
		

Crossrefs

Cf. A239115.

Programs

  • Magma
    k := 1;
         for n in [1..10000] do
            if IsPrime(k*(n - 1)*n^2 + 1) and IsPrime(k*n^2 + n - 1) then
               n;
            end if;
         end for;
  • Mathematica
    Select[Range[600],PrimeQ[#^2+#-1]&&PrimeQ[#^2(#-1)+1]&] (* Farideh Firoozbakht, Mar 17 2014 *)