Skip to main content
3 of 3
more descriptive title
Martin Sleziak
  • 4.7k
  • 4
  • 35
  • 40

Calculating greatest common divisor series: $\gcd(1,x)+\gcd(2,x)+\gcd(3,x)+....+\gcd(x,x)$

How to compute the value of $$[\gcd(1,x)+\gcd(2,x)+\gcd(3,x)+....+\gcd(x,x)]$$ efficiently? When x can be as large as million.