返回题库

完全平方判定

perfect square

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

题目详情

在区间 [100,400][100,400] 内,有多少个整数 nn 使得 nnn^n 是完全平方数?

英文原题

How many integers nn such that nnn^{n} is a perfect square are there in range [100: 400]?

解析

n=piαin=\prod p_i^{\alpha_i},则

nn=pinαi.n^n=\prod p_i^{n\alpha_i}.

要成为完全平方,所有指数 nαin\alpha_i 必须为偶数。

  • nn 为偶数,则任意 αi\alpha_i 都有 nαin\alpha_i 为偶数,恒成立。
  • nn 为奇数,则需每个 αi\alpha_i 都为偶数,即 nn 本身是完全平方数。

因此符合条件的 nn = “所有偶数” + “奇完全平方数”。

  • 区间 [100,400][100,400] 内偶数个数:
    4001002+1=151.\frac{400-100}{2}+1=151.
  • 区间内奇平方数:112,132,152,172,19211^2,13^2,15^2,17^2,19^2,共 5 个。

总数

151+5=156.151+5=\boxed{156}.

英文解析

Let n=piαin=\prod p_i^{\alpha_i}. Then

nn=pinαi.n^n=\prod p_i^{n\alpha_i}.

For nnn^n to be a perfect square, all exponents nαin\alpha_i must be even.

  • If nn is even, then for any αi\alpha_i, nαin\alpha_iis even, which always holds.
  • If nn is odd, then each αi\alpha_i must be even, meaning nn itself is a perfect square.

Thus, the qualifying nn are "all even numbers" plus "odd perfect squares".

  • Number of even numbers in the interval [100,400][100,400]:
    4001002+1=151.\frac{400-100}{2}+1=151.
  • Number of odd perfect squares in the interval: 112,132,152,172,19211^2,13^2,15^2,17^2,19^2, totaling 5.

The total count is

151+5=156.151+5=\boxed{156}.