A143933 a(n) is the smallest prime x such that x^2-n! is also prime.
2, 2, 3, 11, 19, 31, 79, 211, 607, 1931, 6337, 21961, 78919, 295291, 1143563, 4574149, 18859777, 80014843, 348776611, 1559776279, 7147792903, 33526120129, 160785623729, 787685471519, 3938427356629, 20082117944579, 104349745809137, 552166953567737
Offset: 1
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 1..300
Programs
-
Maple
f:= proc(n) local p,t; t:= n!; p:= floor(sqrt(t)); do p:= nextprime(p); if isprime(p^2-t) then return p fi od end proc: map(f, [$1..28]); # Robert Israel, Feb 10 2019
-
Mathematica
f[n_] := Block[{p = NextPrime[ Sqrt[ n!]]}, While[ !PrimeQ[p^2 - n!], p = NextPrime@ p]; p]; Array[f, 27] (* Robert G. Wilson v, Jan 08 2015 *)
-
PARI
a(n)=my(N=n!,x=sqrtint(N)+1); while(!isprime(x^2-N), x=nextprime(x+1)); x \\ Charles R Greathouse IV, Dec 09 2014
Extensions
Corrected by Charles R Greathouse IV, Dec 09 2014
Comments