cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A225944 Numbers k such that prime(k) divides k^k - 1.

This page as a plain text file.
%I A225944 #20 Sep 30 2024 14:11:51
%S A225944 1,2,5,124,181,696,261800,3834909,18836480,51432542,69709961,
%T A225944 332054520,3140421767
%N A225944 Numbers k such that prime(k) divides k^k - 1.
%C A225944 a(14) > 10^12. - _Giovanni Resta_, May 11 2020
%t A225944 Select[Range[10^6], PowerMod[#, #, Prime@#] == 1 &] (* _Giovanni Resta_, May 23 2013 *)
%o A225944 (Python)
%o A225944 primes = []
%o A225944 n = 0
%o A225944 def addPrime(k):
%o A225944   global n
%o A225944   for p in primes:
%o A225944     if k%p==0:  return
%o A225944     if p*p > k:  break
%o A225944   primes.append(k)
%o A225944   n += 1
%o A225944   if (n**n-1) % k == 0: print(n, end=", ")
%o A225944 addPrime(2)
%o A225944 addPrime(3)
%o A225944 for i in range(5, 10000000, 6):
%o A225944   addPrime(i)
%o A225944   addPrime(i+2)
%o A225944 (Python)
%o A225944 from sympy import nextprime, prime
%o A225944 from itertools import count, islice
%o A225944 def agen(startn=1): # generator of terms
%o A225944     pn = prime(startn)
%o A225944     for n in count(startn):
%o A225944         if pow(n, n, pn) == 1:
%o A225944             yield n
%o A225944         pn = nextprime(pn)
%o A225944 print(list(islice(agen(), 7))) # _Michael S. Branicky_, May 25 2023
%Y A225944 Cf. A000040, A000312, A048861, A225945.
%K A225944 nonn,more
%O A225944 1,2
%A A225944 _Alex Ratushnyak_, May 21 2013
%E A225944 a(8)-a(13) from _Giovanni Resta_, May 23 2013