login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A346988 a(n) is the smallest k > n such that n^(k-n) == 1 (mod k). 2
2, 20737, 9299, 7, 13, 311, 15, 127, 17, 37, 14, 23, 17, 157, 106, 31, 29, 312953, 45, 95951, 41, 91, 33, 47, 28, 95, 35, 271, 35, 9629, 39, 311, 85, 397, 46, 71, 43, 1793, 95, 79, 61, 821, 51, 18881, 67, 103, 51, 12409, 73, 409969, 65, 87, 65, 71233, 63, 155, 65, 69, 87, 1962251, 91, 2443783, 155 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Smallest k > n coprime to n such that n^k == n^n (mod k).
If a(n) is a prime p, then n^(n-1) == 1 (mod p).
LINKS
MATHEMATICA
a[n_] := Module[{k = n + 1}, While[PowerMod[n, k - n, k] != 1, k++]; k]; Array[a, 60] (* Amiram Eldar, Aug 10 2021 *)
PROG
(PARI) a(n) = my(k=n+1); while (Mod(n, k)^(k-n) != 1, k++); k; \\ Michel Marcus, Aug 10 2021
(Python)
def A346988(n):
k, kn = n+1, 1
while True:
if pow(n, kn, k) == 1:
return k
k += 1
kn += 1 # Chai Wah Wu, Aug 28 2021
CROSSREFS
Sequence in context: A124364 A173156 A214598 * A339476 A242959 A123692
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Aug 10 2021
EXTENSIONS
More terms from Amiram Eldar, Aug 10 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 11 06:07 EDT 2024. Contains 372388 sequences. (Running on oeis4.)