← Complete problem index

PROJECT EULER · #0072

Counting Fractions

Statement only · SolvedOriginal problem ↗

Consider the fraction, nd, where n and d are positive integers. If n<d and HCF(n,d)=1, it is called a reduced proper fraction.

If we list the set of reduced proper fractions for d8 in ascending order of size, we get: 18,17,16,15,14,27,13,38,25,37,12,47,35,58,23,57,34,45,56,67,78

It can be seen that there are 21 elements in this set.

How many elements would be contained in the set of reduced proper fractions for d1000000?

Write-up coming later

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