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!)
A330342 a(n) is the smallest k such that b^(n-1) == b^k (mod n) for all integers b. 0
0, 1, 2, 3, 4, 1, 6, 3, 2, 1, 10, 3, 12, 1, 2, 7, 16, 5, 18, 3, 2, 1, 22, 3, 4, 1, 8, 3, 28, 1, 30, 7, 2, 1, 10, 5, 36, 1, 2, 3, 40, 5, 42, 3, 8, 1, 46, 7, 6, 9, 2, 3, 52, 17, 14, 7, 2, 1, 58, 3, 60, 1, 2, 15, 4, 5, 66, 3, 2, 9, 70, 5, 72, 1, 14, 3, 16, 5, 78, 7, 26, 1, 82, 5, 4, 1, 2, 7, 88, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Note that (n-1) == a(n) (mod lambda(n)), where lambda(n) = A002322(n).
For n > 1, a(n) = lambda(n) if and only if n is a prime or a Carmichael number. For n <> 1 and 4, a(n) = n-1 if and only if n is a prime.
For n > 2, a(n) = 1 if and only if n is a squarefree 2-Knodel number.
For n > 3, a(n) = 2 if and only if n is a 3-Knodel number.
LINKS
FORMULA
a(n) = A(n) if A(n) >= A051903(n) or a(n) = A002322(n) + A(n) otherwise, where A(n) = ((n-1) mod A002322(n)).
MATHEMATICA
a[n_] := Module[{k = 0}, While[!AllTrue[Range[n], PowerMod[#, n - 1, n] == PowerMod[#, k, n] &], k++]; k]; Array[a, 100] (* Amiram Eldar, Dec 11 2019 *)
CROSSREFS
Sequence in context: A082119 A129708 A071518 * A065338 A316272 A294649
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Dec 11 2019
EXTENSIONS
More terms from Amiram Eldar, Dec 11 2019
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 July 2 23:09 EDT 2024. Contains 373960 sequences. (Running on oeis4.)