The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A197929 Number of distinct residues of x^(n-1) (mod n), x=0..n-1. 4
1, 2, 2, 3, 2, 6, 2, 5, 4, 10, 2, 9, 2, 14, 6, 9, 2, 14, 2, 15, 8, 22, 2, 15, 6, 26, 10, 9, 2, 30, 2, 17, 12, 34, 12, 21, 2, 38, 14, 25, 2, 42, 2, 33, 8, 46, 2, 27, 8, 42, 18, 15, 2, 38, 18, 35, 20, 58, 2, 45, 2, 62, 16, 33, 8, 18, 2, 51, 24, 30, 2, 35, 2, 74 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(n) = 2 if n prime because the residues are 0 and 1 (Fermat's little theorem).
a(n) = n if n = 2p, p prime > 2. But there exists nonprime numbers q such that a(2q) = 2q, for example q = 1, 15, 21, 39,...
LINKS
EXAMPLE
a(8) = 5 because x^7 == 0, 1, 3, 5, 7 (mod 8) => 5 distinct residues.
MATHEMATICA
Length[Union[#]]& /@ Table[Mod[k^(n-1), n], {n, 74}, {k, n}]
CROSSREFS
Sequence in context: A108499 A260895 A107753 * A326849 A328706 A342530
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 19 2011
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 June 6 03:51 EDT 2024. Contains 373110 sequences. (Running on oeis4.)