[go: up one dir, main page]

login
A225944
Numbers k such that prime(k) divides k^k - 1.
2
1, 2, 5, 124, 181, 696, 261800, 3834909, 18836480, 51432542, 69709961, 332054520, 3140421767
OFFSET
1,2
COMMENTS
a(14) > 10^12. - Giovanni Resta, May 11 2020
MATHEMATICA
Select[Range[10^6], PowerMod[#, #, Prime@#] == 1 &] (* Giovanni Resta, May 23 2013 *)
PROG
(Python)
primes = []
n = 0
def addPrime(k):
global n
for p in primes:
if k%p==0: return
if p*p > k: break
primes.append(k)
n += 1
if (n**n-1) % k == 0: print(n, end=", ")
addPrime(2)
addPrime(3)
for i in range(5, 10000000, 6):
addPrime(i)
addPrime(i+2)
(Python)
from sympy import nextprime, prime
from itertools import count, islice
def agen(startn=1): # generator of terms
pn = prime(startn)
for n in count(startn):
if pow(n, n, pn) == 1:
yield n
pn = nextprime(pn)
print(list(islice(agen(), 7))) # Michael S. Branicky, May 25 2023
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Alex Ratushnyak, May 21 2013
EXTENSIONS
a(8)-a(13) from Giovanni Resta, May 23 2013
STATUS
approved