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!)
A079327 Smallest nonnegative integer x such that b^(n-1) == b^x (mod n) for all b that are 0 < b < n. 1
0, 0, 0, 3, 0, 1, 0, 3, 2, 1, 0, 3, 0, 1, 2, 7, 0, 5, 0, 3, 2, 1, 0, 3, 4, 1, 8, 3, 0, 1, 0, 7, 2, 1, 10, 5, 0, 1, 2, 3, 0, 5, 0, 3, 8, 1, 0, 7, 6, 9, 2, 3, 0, 17, 14, 7, 2, 1, 0, 3, 0, 1, 2, 15, 4, 5, 0, 3, 2, 9, 0, 5, 0, 1, 14, 3, 16, 5, 0, 7, 26, 1, 0, 5, 4, 1, 2, 7, 0, 5, 6, 3, 2, 1, 22, 7, 0, 13, 8 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
a(n)=0 iff n=1 or n is prime.
LINKS
EXAMPLE
a(5) = 0, since for all 1 <= b < 5 it is true that b^0 == b^(5-1) (mod 5) (hence 5 is prime).
a(9) = 2, since for all 1 <= b < 9 it is true that b^2 == b^(9-1) (mod 9) (hence 9 is composite).
MATHEMATICA
a[n_] := For[x=0, True, x++, If[Mod[Range[n-1]^(n-1), n]==Mod[Range[n-1]^x, n], Return[x]]]
CROSSREFS
Sequence in context: A213543 A247254 A035640 * A340504 A242447 A238342
KEYWORD
easy,nonn
AUTHOR
Gottfried Helms, Feb 13 2003
EXTENSIONS
Edited by Dean Hickerson, Feb 15 2003
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 April 23 01:19 EDT 2024. Contains 371906 sequences. (Running on oeis4.)