login
Numbers k such that k^k - (k-1)^k + k is prime.
0

%I #27 Oct 10 2024 01:11:09

%S 1,2,4,16,52,80

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

%C a(6) corresponds to a prime having 153 digits.

%C If it exists, a(7) > 5000.

%C k does not have the form 20m+2 (which leads to a multiple of 5) or 42m+26 (which leads to a multiple of 7).

%C If it exists, a(7) > 20000. - _Michael S. Branicky_, Oct 09 2024

%e 4 is in the sequence because 4^4 - 3^4 + 4 = 179 is prime.

%t Select[Range[1000], PrimeQ[#^# - (# - 1)^# + #] &]

%o (Magma) [n: n in [0..500] |IsPrime(n^n - (n-1)^n + n)];

%o (PARI) is(n)=ispseudoprime(n^n-(n-1)^n+n) \\ _Charles R Greathouse IV_, Jun 13 2017

%Y Cf. A085682.

%K nonn,more

%O 1,2

%A _Vincenzo Librandi_, Mar 13 2015