English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

The only possibilities are -1,0,1 The reason is that if n+1

is prime, then n! +1 = 0 mod (n+1). If n+1 is composite, then

n!+1 = 1mod(n+1) with the only exception at 3! +1= -1mod4.

2007-06-22 09:02:26 · answer #1 · answered by knashha 5 · 3 0

It can't be zero for composite (n+1).

Wilson's Theorem states that (p-1)! = -1 (mod p) if and only if p is prime. Replacing p with n+1 and adding 1 to both sides, we get that n! + 1 = 0 (mod n+1) if and only if (n+1) is prime.

So we have the value when n+1 is prime.

EDIT: Apparently knashha is the winner. Could you explain the second step though, the composite case? It seems like you took the composite case to be a consequence of the prime case, and I'm not seeing it.

EDIT2: Oh I see, (n+1) divides n! for n>5. Got it.

2007-06-22 15:58:39 · answer #2 · answered by TFV 5 · 1 0

fedest.com, questions and answers