login

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

Numbers k whose last k digits of k^k form a prime number.
1

%I #21 Sep 29 2024 03:06:12

%S 143,433,1687,3283,14949

%N Numbers k whose last k digits of k^k form a prime number.

%C a(6) > 10^5. - _Michael S. Branicky_, Sep 28 2024

%t f[n_] := FromDigits[Take[IntegerDigits[n^n], -n]]; Do[If[PrimeQ[f[n]], Print[n]], {n, 8, 14949}] (* _Ryan Propper_, Apr 01 2007 *)

%o (Python)

%o from sympy import isprime

%o A126703_list = [n for n in range(1,2000) if isprime(pow(n,n,10**n))] # _Chai Wah Wu_, Mar 23 2018

%Y Indices of primes in A086756.

%K base,hard,more,nonn

%O 1,1

%A _Shyam Sunder Gupta_, Feb 11 2007

%E a(5) from _Ryan Propper_, Apr 01 2007