Ma · Mathematics

Why Does x4≡−1(modp)x^4 \equiv -1 \pmod p Imply p≡1(mod8)p \equiv 1 \pmod 8?

Published By the 9to5Science editorial team

At a glance

  1. 1. Check the prime

    Assume p is an odd prime. The prime p = 2 is an exception because -1 is congruent to 1 modulo 2.

  2. 2. Raise to the Eighth Power

    The congruence gives x^8 congruent to 1 modulo p, while x^4 is not congruent to 1.

  3. 3. Find the Order

    Therefore x has multiplicative order 8 in the nonzero residues modulo p.

  4. 4. Use the Group Size

    An element’s order divides p − 1, so 8 divides p − 1 and p is congruent to 1 modulo 8.

Advertisement

For an odd prime pp, the congruence x4≡−1(modp)x^4 \equiv -1 \pmod p forces p≡1(mod8)p \equiv 1 \pmod 8. The key is to look at the multiplicative order of xx modulo pp. The prime p=2p=2 needs separate treatment: modulo 2, −1≡1-1\equiv 1, so the claimed implication does not hold.

Why the order of x is 8

Since pp is odd, 11 and −1-1 are distinct modulo pp. In particular, the assumption says x4x^4 is not congruent to 11 modulo pp. Squaring the given congruence gives

x8≡(−1)2≡1(modp).x^8 \equiv (-1)^2 \equiv 1 \pmod p.

The multiplicative order of xx modulo pp is the smallest positive integer dd for which xd≡1(modp)x^d\equiv 1\pmod p. It exists here because x8≡1(modp)x^8\equiv 1\pmod p. The order dd must divide 8, but it cannot divide 4: if it did, then x4x^4 would be congruent to 1, contrary to the assumption. The divisors of 8 are 1,2,4,81,2,4,8, and only 8 does not divide 4. Therefore d=8d=8.

This also shows xx is nonzero modulo pp, as required to belong to the multiplicative group of nonzero residues.

Why this forces p to be 1 modulo 8

The nonzero residues modulo a prime pp form a group with p−1p-1 elements. By Lagrange’s theorem, the order of any element in a finite group divides the number of elements in that group. Since xx has order 8,

8∣(p−1).8\mid(p-1).

Thus p−1p-1 is a multiple of 8, which is exactly the statement

p≡1(mod8).p\equiv 1\pmod 8.

An equivalent route is to use Fermat’s little theorem: for x≢0(modp)x\not\equiv0\pmod p, xp−1≡1(modp)x^{p-1}\equiv1\pmod p. The order of xx divides every exponent that gives 1, including p−1p-1, so again 8∣p−18\mid p-1.

Worked example: p = 17

Take x=2x=2 and p=17p=17. Then

24=16≡−1(mod17),2^4=16\equiv -1\pmod{17},

so the condition is satisfied. Also 17−1=1617-1=16 is divisible by 8, and 17≡1(mod8)17\equiv1\pmod8, as the result predicts. The powers of 2 confirm that its order is 8: 24≡−1(mod17)2^4\equiv-1\pmod{17}, hence 28≡1(mod17)2^8\equiv1\pmod{17}, while no exponent dividing 4 gives 1.

For contrast, there can be no solution modulo 7. If there were, the argument above would imply 7≡1(mod8)7\equiv1\pmod8, which is false.

Is the converse also true?

For odd primes, yes. If p≡1(mod8)p\equiv1\pmod8, then the nonzero residues modulo pp form a cyclic group of order p−1p-1. Let gg be a generator and set x=g(p−1)/8x=g^{(p-1)/8}. Then

x4=g(p−1)/2≡−1(modp).x^4=g^{(p-1)/2}\equiv-1\pmod p.

The last congruence follows because a generator raised to half the group’s order is the unique element of order 2, namely −1-1 modulo an odd prime. Consequently, for odd primes, x4≡−1(modp)x^4\equiv-1\pmod p has a solution exactly when p≡1(mod8)p\equiv1\pmod8.

Common mistakes

  • Forgetting p=2p=2. Modulo 2, 1≡−11\equiv-1, so x=1x=1 satisfies the congruence even though 2≢1(mod8)2\not\equiv1\pmod8. State that the prime is odd.
  • Saying only that x8≡1x^8\equiv1. This says the order divides 8, not that it equals 8. You also need x4≢1x^4\not\equiv1, which rules out orders 1, 2, and 4.
  • Applying Fermat’s theorem without checking x≠0x\ne0. Here xx cannot be zero modulo an odd prime, since 040^4 is not congruent to −1-1 modulo pp.

If the modulus is an odd composite integer rather than a prime, the same conclusion still follows by reducing the congruence modulo each prime divisor: every prime divisor must be 1 modulo 8, so their product, including prime powers, is also 1 modulo 8. The group-order proof above is the standard direct argument for a prime modulus.

References

  1. A Classical Introduction to Modern Number Theory — Kenneth Ireland and Michael Rosen

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.