login
Prime numbers p such that p^3 - p + 1 and p^3 + p - 1 are both primes.
0

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

%S 7,139,631,739,769,991,1201,1231,2677,3499,3931,4261,4441,4861,6247,

%T 7411,7699,8377,9391,10711,10837,14389,15139,15679,16057,16561,18541,

%U 20479,22861,28111,28837,29917,30169,30367,32089,33589,35311,35677

%N Prime numbers p such that p^3 - p + 1 and p^3 + p - 1 are both primes.

%e 7^3 +- 6 -> (337, 349) (both primes),

%e 139^3 +- 138 -> (2685481, 2685757) (both primes).

%p a:=proc (n) if isprime(n)=true and isprime(n^3+n-1)=true and isprime(n^3-n+1) =true then n else end if end proc: seq(a(n),n=1..30000); # _Emeric Deutsch_, Apr 29 2008

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

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

%K nonn

%O 1,1

%A _Vladimir Joseph Stephan Orlovsky_, Apr 21 2008

%E More terms from _Emeric Deutsch_, Apr 29 2008