Hint 1 Project Euler Problem 484 Arithmetic Derivative
Arithmetic Derivative
Problem 484
The arithmetic derivative is defined by
Find ∑ gcd(k,k') for 1 < k ≤ 5·1015
Note: gcd(x,y) denotes the greatest common divisor of x and y.
- p' = 1 for any prime p
- (ab)' = a'b + ab' for all integers a, b (Leibniz rule)
Find ∑ gcd(k,k') for 1 < k ≤ 5·1015
Note: gcd(x,y) denotes the greatest common divisor of x and y.
If k=p1^a1 * p2^a2 * ... * pn^an
Then k' = a1*p1^(a1-1)*(k/(p1^a1)) + ... + an*pn^(an-1)*(k/(pn^an))
k' = k*(a1/p1 + a2/p2 + ... + an/pn)
It is easy to conduct that,
unless exists pi|ai, gcd(k,k') = k/(p1*p2*...*pn)
If exists pi|ai, then we have a bonus pi in gcd,
gcd(k,k') = k/(p1*p2*...*pn) * pi
The next step is how do we sum it up within reasonable complexity.
---------------------
The opinion above is original and unproven work. Please correct me if I made a mistake.
Please tell me if you have reached the correct answer using the methods above.
I am just too lazy to calculate that. :)
The opinion above is original and unproven work. Please correct me if I made a mistake.
Please tell me if you have reached the correct answer using the methods above.
I am just too lazy to calculate that. :)
Comments
Post a Comment