So, I was doing some Project Euler.
I got the solution via my program but it took about 2 hours to run since it was a brute force solution.
However, once you solve the problem you can access the thread for that problem and see other people solutions. There solutions were dead simple but I don't understand the maths of why it works.
Here's the puzzle:
The solutions that other people used was 2*3*5*7*11*13*17 (basically the product of all the primes so that the result is less than 1,000,000.
Why is that the solution ?
I got the solution via my program but it took about 2 hours to run since it was a brute force solution.
However, once you solve the problem you can access the thread for that problem and see other people solutions. There solutions were dead simple but I don't understand the maths of why it works.
Here's the puzzle:
Euler's Totient function, Æ(n) [sometimes called the phi function], is used to determine the number of numbers less than n which are relatively prime to n. For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and relatively prime to nine, Æ(9)=6.
It can be seen that n=6 produces a maximum n/Æ(n) for n ≤ 10.
Find the value of n ≤ 1,000,000 for which n/Æ(n) is a maximum.
The solutions that other people used was 2*3*5*7*11*13*17 (basically the product of all the primes so that the result is less than 1,000,000.
Why is that the solution ?