A065797 Numbers k such that k^k - k + 1 is prime.
2, 5, 13, 155, 1551, 1841, 2167, 2560
Offset: 1
Links
- Eric Weisstein's World of Mathematics, Primality Test
Programs
-
Maple
select(n -> isprime(n^n-n+1), [$1..3000]); # Robert Israel, Dec 29 2014
-
Mathematica
Do[If[PrimeQ[n^n-n+1], Print[n]], {n, 1, 3000}]
-
PARI
is(n)=ispseudoprime(n^n-n+1) \\ Charles R Greathouse IV, Jun 13 2017
-
Sage
[n for n in (1..155) if (n^n-n+1).is_prime(proof=True)] # deterministic test
-
Sage
[n for n in (1..5000) if (n^n-n+1).is_prime(proof=False)] # probabilistic test Giuseppe Coppoletta, Dec 26 2014
Extensions
More terms from John Sillcox (JMS21187(AT)aol.com), Apr 23 2003
Comments