IA idea · Pure maths, number & proof

How many primes are there below n? Testing the prime number theorem

AA SLAA HLAI SL Solid Also in: Statistics, Modelling

Research question

How accurately do x/ln x and the logarithmic integral approximate the number of primes below x for x up to 10⁷, and how does the relative error behave?

Adapt it: change the place, the data or the comparison until the question is yours.

Why it makes a good exploration

Primes look random, yet their count follows a smooth law. Testing the approximations yourself, and measuring how slowly the error shrinks, connects number theory with modelling.

The mathematics you'll need

  • Counting functions and logarithms
  • Relative and absolute error
  • Integration: the logarithmic integral (explain; evaluate numerically)
  • Modelling error against x on log scales

Course labels show where a technique sits; using maths from outside your course is fine if you explain it clearly and say it is new to you.

Where the data comes from

Generate primes with a sieve (spreadsheet or program); check counts against OEIS.

Cite every source in a footnote where you use it and in your bibliography. Check the licence of any dataset you download.

A possible outline

  1. Explain the sieve and count primes.
  2. Compare with x/ln x.
  3. Compare with Li(x).
  4. Model the relative error.
  5. Reflect on why the prime number theorem is about ratios, not differences.

Pitfalls that cost marks

  • Code with no explanation.
  • Confusing log bases.
  • Presenting tables without interpretation.

Showing personal engagement

  • Explore twin primes or primes in arithmetic progressions.
  • Make a prediction for 10⁸ and check with published counts.
  • Explain the theorem's history briefly.

See Criterion C: personal engagement for what examiners look for.

Taking it further

Investigate the average gap between primes near x and compare with ln x.

Turn this idea into your IA

Similar ideas

All pure maths ideas · Browse all 153 IA ideas