login
Primes of the form (k+1)^k - k^(k-1).
0

%I #15 Jan 07 2025 09:51:59

%S 7,7151,109873,956953279,3497141354765072424170242943188801

%N Primes of the form (k+1)^k - k^(k-1).

%C Next term too large to be included (1652 digits)

%e 3^2-2^1 = 9-2 = 7.

%p 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);

%t Select[Table[(n + 1)^n - n^(n - 1), {n, 1000}], PrimeQ] (* _Michael De Vlieger_, Apr 22 2015 *)

%o (PARI) select(isprime, vector(9,n,(n+1)^n-n^(n-1))) \\ _Charles R Greathouse IV_, Apr 22 2015

%Y Primes in A178922.

%Y Cf. A054463.

%K easy,nonn

%O 1,1

%A _Paolo P. Lava_ & _Giorgio Balzarotti_, Mar 18 2009