login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers k such that k*(k-1)^k-(k-1)*k^(k-1)-1 is prime.
5

%I #11 Jan 10 2022 11:41:21

%S 3,4,6,9,31,187,632,2972

%N Numbers k such that k*(k-1)^k-(k-1)*k^(k-1)-1 is prime.

%e a(1)=3 because 3*2^3-2*3^2-1=5 is prime, a(2)=4 because 4*3^4-3*4^3-1=131 is prime, a(3)=6 because 6*5^6-5*6^5-1=54869 is prime, a(4)=9 because 9*8^9-8*9^8-1=863585783 is prime.

%o (Python)

%o from sympy import isprime

%o def afind(limit, startk=1):

%o for k in range(startk, limit+1):

%o if isprime(k*(k-1)**k - (k-1)*k**(k-1) - 1):

%o print(k, end=", ")

%o afind(200) # _Michael S. Branicky_, Jan 10 2022

%Y Cf. A191409 (associated primes).

%K nonn,hard

%O 1,1

%A _Juri-Stepan Gerasimov_, Jun 12 2011

%E a(8) from _Michael S. Branicky_, Jan 10 2022