login
Positive numbers k such that k^3 - (k+1)^2 and k^3 + (k+1)^2 are both primes.
2

%I #15 Sep 08 2022 08:45:32

%S 3,8,15,35,39,45,50,65,92,99,122,140,164,167,170,198,237,284,287,297,

%T 339,354,408,435,515,522,552,582,594,650,668,708,725,737,753,830,1010,

%U 1068,1098,1128,1253,1295,1373,1424,1502,1548,1553,1599,1704,1779,1817

%N Positive numbers k such that k^3 - (k+1)^2 and k^3 + (k+1)^2 are both primes.

%H Harvey P. Dale, <a href="/A137475/b137475.txt">Table of n, a(n) for n = 1..1000</a>

%e 3^3 +- 4^2 -> (11, 43) (both primes);

%e 167^3 +- 168^2 = 4657463 +- 28224 -> (4629239, 4685687) (both primes).

%t Select[Range[900],PrimeQ[ #^3-(#+1)^2]&&PrimeQ[ #^3+(#+1)^2]&]

%t bpQ[n_]:=Module[{a=(n+1)^2},AllTrue[n^3+{a,-a},PrimeQ]]; Select[Range[ 2,2000],bpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Oct 17 2019 *)

%o (Magma) [n: n in [2..500] | IsPrime(n^3-(n+1)^2)and IsPrime(n^3 +(n+1)^2)] // _Vincenzo Librandi_, Nov 24 2010

%K nonn

%O 1,1

%A _Vladimir Joseph Stephan Orlovsky_, Apr 21 2008

%E More terms from _Vincenzo Librandi_, Mar 26 2010