Alternating GCD Sum (noch nicht übersetzt)
Problem 795
For a positive integer n, the function g(n) is defined as
g(n)=n∑i=1(−1)igcd(n,i2)
For example, g(4)=−gcd(4,12)+gcd(4,22)−gcd(4,32)+gcd(4,42)=−1+4−1+4=6.
You are also given g(1234)=1233.
Let G(N)=N∑n=1g(n). You are given G(1234)=2194708.
Find G(12345678).