← Complete problem index

PROJECT EULER · #0464

Möbius Function and Intervals

Statement only · UnsolvedOriginal problem ↗

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:

  • 1abn,
  • 99N(a,b)100P(a,b), and
  • 99P(a,b)100N(a,b).

For example, C(10)=13, C(500)=16676 and C(10000)=20155319.

Find C(20000000).

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.