All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Remainder (Posted on 2003-10-16) Difficulty: 3 of 5
If 'p' be a prime, then what is the remainder when (p - 1)! is divided by p?

See The Solution Submitted by Ravi Raja    
Rating: 3.8889 (9 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Hints/Tips re: By inspection... | Comment 2 of 10 |
(In reply to By inspection... by Brian Smith)

Indeed it works for the first 35 primes as the following output shows:


list
5 for I=1 to 35
10 P=nxtprm(P)
20 print p, (!(P)-1)@P
30 next
run
2 1
3 2
5 4
7 6
11 10
13 12
17 16
19 18
23 22
29 28
31 30
37 36
41 40
43 42
47 46
53 52
59 58
61 60
67 66
71 70
73 72
79 78
83 82
89 88
97 96
101 100
103 102
107 106
109 108
113 112
127 126
131 130
137 136
139 138
149 148
OK

----------
The above is a UBASIC program, that language having the built-in nxtprm function and factorial function.
  Posted by Charlie on 2003-10-16 09:52:36
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information