login

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

Numbers k such that prime(k) divides k^k + 1.
1

%I #13 May 25 2023 11:01:29

%S 1,6,60,136,124796,3919272,18363918,153037808,965108649,3140421892,

%T 5961162423,20437804784

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

%C a(12) > 2*10^10. - _Giovanni Resta_, May 23 2013

%t Select[Range[10^6], (p = Prime[#]; PowerMod[#, #, p] == p - 1) &] (* _Giovanni Resta_, May 23 2013 *)

%o (Python)

%o from sympy import nextprime, prime

%o from itertools import count, islice

%o def agen(startn=1): # generator of terms

%o pn = prime(startn)

%o for n in count(startn):

%o if pow(n, n, pn) == pn - 1:

%o yield n

%o pn = nextprime(pn)

%o print(list(islice(agen(), 5))) # _Michael S. Branicky_, May 25 2023

%Y Cf. A000040, A000312, A014566, A225944.

%K nonn,more

%O 1,2

%A _Alex Ratushnyak_, May 21 2013

%E a(6)-a(11) from _Giovanni Resta_, May 23 2013

%E a(12) from _Michael S. Branicky_, May 25 2023