login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A071710 Highly Wilsonian primes: smallest primes p such that w(p)=n where w(n) denote the number of nonnegative integers k such that k! = +1 or -1 (mod n). 1
2, 3, 5, 7, 17, 67, 137, 23, 61, 71, 401, 1907, 661, 12227, 29873, 96731, 99721, 154243, 480209, 3408707, 1738901, 27341387 (list; graph; refs; listen; history; internal format)
OFFSET

2,1

COMMENTS

Obviously w(n) is at least 2 because 0! = 1! = +1 (mod n) for every n. Also, if p is a prime, then w(p) is at least 4 because (p-2)! = +1 and (p-1)! = -1 (mod p) by Wilson's Theorem.

LINKS

K. S. Brown, Highly Wilsonian Primes

Charles R Greathouse IV, Home Page [Listed in lieu of email address]

Igor Naverniouk, C++ program

MATHEMATICA

w[n_] := Block[{c = k = m = 1}, While[k < n, m = Mod[m *= k, n]; If[m == 1 || m + 1 == n, c++ ]; k++ ]; c]

PROG

(PARI) wilsonian(p)={ local(s, t, pMinusOne); pMinusOne=p-1; s=4; t=24; for(k=5, p-3, t=(t*k)%p; if(t==1 || t==pMinusOne, s=s+1) ); s } -Charles R Greathouse IV Jan 24 2007

CROSSREFS

Sequence in context: A168034 A034970 A048417 * A048403 A000519 A088732

Adjacent sequences:  A071707 A071708 A071709 * A071711 A071712 A071713

KEYWORD

hard,more,nonn,changed

AUTHOR

Benoit Cloitre (benoit7848c(AT)orange.fr), Jun 03 2002

EXTENSIONS

2 more terms from Charles R Greathouse IV Jan 24 2007

a(23) from Igor Naverniouk (igor(AT)cs.utoronto.ca), May 09 2007

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 19:13 EST 2012. Contains 206085 sequences.