A158400 Primes of the form (k+1)^k - k^(k-1).
7, 7151, 109873, 956953279, 3497141354765072424170242943188801
Offset: 1
Examples
3^2-2^1 = 9-2 = 7.
Programs
-
Maple
P:=proc(i) local a,n; for n from 2 by 1 to i do a:=n^(n-1)-(n-1)^(n-2); if isprime(a) then print(a); fi; od; end: P(2000);
-
Mathematica
Select[Table[(n + 1)^n - n^(n - 1), {n, 1000}], PrimeQ] (* Michael De Vlieger, Apr 22 2015 *)
-
PARI
select(isprime, vector(9,n,(n+1)^n-n^(n-1))) \\ Charles R Greathouse IV, Apr 22 2015
Comments