What is the value of 1 + 2 + 3 +...+ (p-1)(mod p)?

  • Thread starter Thread starter teddyayalew
  • Start date Start date
Click For Summary

Homework Help Overview

The problem involves finding the value of the sum 1 + 2 + 3 + ... + (p-1) modulo p, where p is specified to be a prime number. Participants explore the implications of this sum under different conditions, particularly focusing on the behavior of the sum when p takes on various values.

Discussion Character

  • Exploratory, Assumption checking, Conceptual clarification

Approaches and Questions Raised

  • Some participants attempt to derive the sum using the formula for the sum of an arithmetic series and explore its properties under modulo p. Others question how the parity of p (even or odd) affects the outcome, noting different results for specific values of p.

Discussion Status

The discussion includes various interpretations of the problem, with some participants providing insights into the nature of the sum and its divisibility by p. There is acknowledgment of the special case when p equals 2, leading to further clarification and exploration of the implications of this case.

Contextual Notes

Participants note that p is a prime number, which influences the properties of the sum. There is also mention of the need to consider special cases, particularly for the smallest prime, p = 2.

teddyayalew
Messages
35
Reaction score
0

Homework Statement


What is the value of 1 + 2 + 3 +...+ (p-1)(mod p)?


Homework Equations



p = 0 (mod p)
p-1 = -1 (mod p)
1 + 2 + 3 + ...+n = n(n+1)/2

The Attempt at a Solution



I know 1 + 2 + 3 +...+ (p-1) = (p-1)(p)/2

I worked the problem, but i don't know if i am correct:

work: i am looking for a b s.t.

b = (p-1)(p)/2 (mod p) or 2b = (p-1)(p) ( mod p)
we know (p-1) = -1 (mod p)
so : (p-1)p = -p (mod p)
this implies : 2b = -p(mod p) ,also we know p = 0 (mod p) so b =0 (mod p)

So the answer is 1 + 2 + 3 +...+ (p-1) = 0 (mod p)
 
Physics news on Phys.org
teddyayalew said:

Homework Statement


What is the value of 1 + 2 + 3 +...+ (p-1)(mod p)?

Homework Equations



p = 0 (mod p)
p-1 = -1 (mod p)
1 + 2 + 3 + ...+n = n(n+1)/2

The Attempt at a Solution



I know 1 + 2 + 3 +...+ (p-1) = (p-1)(p)/2

I worked the problem, but i don't know if i am correct:

work: i am looking for a b s.t.

b = (p-1)(p)/2 (mod p) or 2b = (p-1)(p) ( mod p)
we know (p-1) = -1 (mod p)
so : (p-1)p = -p (mod p)
this implies : 2b = -p(mod p) ,also we know p = 0 (mod p) so b =0 (mod p)

So the answer is 1 + 2 + 3 +...+ (p-1) = 0 (mod p)

I get different answers depending on whether p is even or odd.

For example, if p = 6, 1 + 2 + 3 + 4 + 5 ##\equiv## 3 (mod 6).

If p = 5, 1 + 2 + 3 + 4 ##\equiv## 0 (mod 5).
 
BTW, what you're calculating is (1 + 2 + ... + (p -1))(mod p).
 
Mark, I am sorry I was not clear, when I say p I mean a prime number.
 
How about if p = 2, the only even prime?

1 ≠ 0 (mod 2)
 
Well, you have the right idea by writting
1+2+\cdots+(p-1) = \frac{(p-1)p}{2}

But then you sort of take the long route to the eventual answer.

When you have this:
1 + \cdots + (p-1) = \frac{(p-1)p}{2}

just note that p-1 is even so that (p-1)/2 is an integer. Thus, the sum is divisible by p and so the answer is 0.

But, yes, your answer is correct.

EDIT:
As Mark mentioned, you'll have to do a special case for 2. In fact, this happens a lot in Number Theory.
 
I see.
So if p=2 then I know the sum is : 1 + 1 = 2, which is congruent to 0 mod 2 as well.

Thank you both for you help!
 
teddyayalew said:
I see.
So if p=2 then I know the sum is : 1 + 1 = 2, which is congruent to 0 mod 2 as well.

Thank you both for you help!
No. If p = 2, the sum has only one term (you quit at 2 - 1 = 1).
 

Similar threads

Replies
30
Views
3K
Replies
15
Views
4K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
Replies
6
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 16 ·
Replies
16
Views
2K
Replies
6
Views
2K
Replies
4
Views
1K