Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A079327
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A079327 Smallest nonnegative integer x such that b^(n-1) == b^x (mod n) for all b such that 0<b<n. +0
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; listen)
OFFSET

1,4

COMMENT

a(n)=0 iff n=1 or n is prime.

EXAMPLE

a(5) = 0, since for all 1<=b<5 it is true that b^0 mod 5 == b^(5-1) mod 5 (hence 5 is prime). a(9) = 2, since for all 1<=b<9 it is true that b^2 mod 9 == 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

Adjacent sequences: A079324 A079325 A079326 this_sequence A079328 A079329 A079330

Sequence in context: A109718 A053385 A035640 this_sequence A123878 A108197 A049769

KEYWORD

easy,nonn

AUTHOR

Gottfried Helms (helms(AT)uni-kassel.de), Feb 13 2003

EXTENSIONS

Edited by Dean Hickerson (dean(AT)math.ucdavis.edu), Feb 15 2003

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified October 15 09:18 EDT 2008. Contains 145015 sequences.


AT&T Labs Research