Problem 464
Möbius function and intervals
The Möbius function, denoted μ(n), is defined as:
- μ(n) = (-1)ω(n) if n is squarefree (where ω(n) is the number of distinct prime factors of n)
- μ(n) = 0 if n is not squarefree.
Let P(a,b) be the number of integers n in the interval [a,b] such that μ(n) = 1.
Let N(a,b) be the number of integers n in the interval [a,b] such that μ(n) = -1.
For example, P(2,10) = 2 and N(2,10) = 4.
Let C(n) be the number of integer pairs (a,b) such that:
- 1 ≤ a ≤ b ≤ n,
- 99·N(a,b) ≤ 100·P(a,b),
- 99·P(a,b) ≤ 100·N(a,b).
For example, C(10) = 13, C(500) = 16676 and C(10 000) = 20155319.
Find C(20 000 000).
莫比乌斯函数和区间
莫比乌斯函数μ(n)按照如下方式定义:
- μ(n) = (-1)ω(n),如果n是无平方因子的(其中ω(n)是n的不同质因数的个数)
- μ(n) = 0 如果n不是无平方因子的。
记P(a,b)是在区间[a,b]中使得μ(n) = 1的整数n的个数。
记N(a,b)是在区间[a,b]中使得μ(n) = -1的整数n的个数。
举例而言,P(2,10) = 2,N(2,10) = 4.
记C(n)是满足如下条件的整数对(a,b)的数目:
- 1 ≤ a ≤ b ≤ n,
- 99·N(a,b) ≤ 100·P(a,b),
- 99·P(a,b) ≤ 100·N(a,b).
例如,C(10) = 13,C(500) = 16676,而C(10 000) = 20155319.
求C(20 000 000)。