Cannot figure out the error....

Правка en1, от Shameek, 2020-04-26 17:09:18

link to question

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

its not giving correct anwer from around 1650... can someone please help?

(P.S. i know that using sieve its n loglog n but both the editorial and my solution are sqrt n to it)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Shameek 2020-04-26 17:26:29 45
en1 Английский Shameek 2020-04-26 17:09:18 680 Initial revision (published)