|
|
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
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|