返回题库

质数问题

prime numbers

专题
Brainteaser / 脑筋急转弯
难度
L4

题目详情

  1. 证明质数有无穷多个。

  2. 两个相邻质数的均值是否可能是质数?

  3. 设质数 p5p\ge 5,证明 24(p21)24\mid (p^2-1)

英文原题

  1. Prove that there is an infinity of prime numbers.

  2. Can the mean of two consecutive prime numbers ever be prime?

3.We consider a prime number p5p\geq 5 .Prove that 24 divides (p21)(p^{2} - 1) i.e. 24(p21)24|(p^{2} - 1)

解析

(1)(欧几里得)假设质数只有有限多个 p1,,pnp_1,\ldots,p_n。令

N=p1p2pn+1.N=p_1p_2\cdots p_n+1.

NN 除以任意 pip_i 都余 1,因此不被任何 pip_i 整除。于是 NN 要么本身是质数,要么有某个不在列表中的质因子,矛盾。故质数无穷多。

(2) 不可能。

除 2 以外质数都为奇数,因此两个相邻质数(都大于 2)为奇数,均值

p+q2\frac{p+q}{2}

是介于 ppqq 之间的整数。若它是质数,则它是位于 ppqq 之间的质数,与“相邻质数”矛盾。

(3)p5p\ge 5 的质数,pp 为奇数且不被 3 整除。

  • 模 8:任意奇数 p1,3,5,7(mod8)p\equiv 1,3,5,7\pmod 8,平方都满足 p21(mod8)p^2\equiv 1\pmod 8,所以 8(p21)8\mid(p^2-1)
  • 模 3:因为 p≢0(mod3)p\not\equiv 0\pmod 3,所以 p±1(mod3)p\equiv \pm 1\pmod 3,从而 p21(mod3)p^2\equiv 1\pmod 3,所以 3(p21)3\mid(p^2-1)

lcm(8,3)=24\mathrm{lcm}(8,3)=24,因此 24(p21)\boxed{24\mid(p^2-1)}


英文解析

(1) (Euclid) Assume there are only finitely many primes p1,,pnp_1, \ldots, p_n. Let
N=p1p2pn+1.N=p_1p_2\cdots p_n+1.
Then NN leaves a remainder of 1 when divided by any pip_i, so it is not divisible by any pip_i. Thus, NNis either itself prime or has a prime factor not in the list, a contradiction. Therefore, there are infinitely many primes.

(2) Impossible.

Except for 2, all primes are odd. Therefore, two adjacent primes (both greater than 2) are odd, and their mean
p+q2\frac{p+q}{2}
is an integer between pp and qq. If it is prime, then it is a prime located between ppand qq, contradicting that they are "adjacent primes."

(3) For primes p5p \ge 5, ppis odd and not divisible by 3.

  • Modulo 8: For any odd prime p1,3,5,7(mod8)p \equiv 1,3,5,7 \pmod 8, the square satisfies p21(mod8)p^2 \equiv 1 \pmod 8, so 8(p21)8 \mid (p^2-1).
  • Modulo 3: Since p≢0(mod3)p \not\equiv 0 \pmod 3, we have p±1(mod3)p \equiv \pm 1 \pmod 3, thus p21(mod3)p^2 \equiv 1 \pmod 3, so 3(p21)3 \mid (p^2-1).

Since lcm(8,3)=24\mathrm{lcm}(8,3)=24, we have 24(p21)\boxed{24\mid(p^2-1)}.