← Complete problem index

PROJECT EULER · #0541

Divisibility of Harmonic Number Denominators

Statement only · UnsolvedOriginal problem ↗

The nth harmonic number Hn is defined as the sum of the multiplicative inverses of the first n positive integers, and can be written as a reduced fraction an/bn.
Hn=k=1n1k=anbn, with gcd(an,bn)=1.

Let M(p) be the largest value of n such that bn is not divisible by p.

For example, M(3)=68 because H68=a68b68=140940183219078279239542016112933773379069966367528193600, b68=2933773379069966367528193600 is not divisible by 3, but all larger harmonic numbers have denominators divisible by 3.

You are given M(7)=719102.

Find M(137).

Write-up coming later

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