We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
hint:-
if we see here from the description table ,the prime no. has more no. of relative primes.
1 is considered as relative prime for every no.
for n/phi(n) should be large ,phi(n) should be small and n should be large.
just consider n as product of prime no.and check whether its smaller than the given limit.
phi(n)=n*(1-(1/p)), where p is prime.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Project Euler #69: Totient maximum
You are viewing a single comment's thread. Return to all comments →
hint:- if we see here from the description table ,the prime no. has more no. of relative primes. 1 is considered as relative prime for every no. for n/phi(n) should be large ,phi(n) should be small and n should be large. just consider n as product of prime no.and check whether its smaller than the given limit. phi(n)=n*(1-(1/p)), where p is prime.