[link to question](https://www.hackerearth.com/practice/math/number-theory/basic-number-theory-2/practice-problems/algorithm/zoro-and-his-curiosity-1/description/)↵
↵
but that isnt my doubt↵
↵
so sum of all coprime numbers with n upto n = sum of all numbers part of phi(n) = phi(n)*(n/2)↵
↵
i wrote the code for it..↵
apparently my function where i do the above computation was erroneous..↵
↵
i tried stresstesting...[here is my codee](https://ideone.com/qg9akU)↵
↵
its not giving correct anwer from around 1650... can someone please help?↵
my functionname is phifunc editorial is phi↵
↵
(P.S. i know that using sieve its n loglog n but both the editorial and my solution are sqrt n to it)↵
↵
↵
but that isnt my doubt↵
↵
so sum of all coprime numbers with n upto n = sum of all numbers part of phi(n) = phi(n)*(n/2)↵
↵
i wrote the code for it..↵
apparently my function where i do the above computation was erroneous..↵
↵
i tried stresstesting...[here is my codee](https://ideone.com/qg9akU)↵
↵
its not giving correct anwer from around 1650... can someone please help?↵
my functionname is phifunc editorial is phi↵
↵
(P.S. i know that using sieve its n loglog n but both the editorial and my solution are sqrt n to it)↵
↵