OFFSET
1,2
LINKS
Peter Kagey, Table of n, a(n) for n = 1..10000
Project Euler, Problem 484: Arithmetic Derivative
MATHEMATICA
Accumulate@ Table[GCD[n, If[Abs@ n < 2, 0, n Total[#2/#1 & @@@ FactorInteger@ Abs@ n]]], {n, 58}] (* Michael De Vlieger, Feb 14 2016, after Michael Somos at A003415 *)
Accumulate@ Table[GCD[n, If[Abs@ n < 2, 0, n Total[#2/#1 & @@@ FactorInteger@ Abs@ n]]], {n, 58}] (* Michael De Vlieger, Feb 14 2016 *)
PROG
(Ruby)
require 'prime'
def a003415(n)
return 0 if n == 1
return 1 if Prime.prime?(n)
a = Prime.each.find { |i| n % i == 0 }
a * a003415(n/a) + n/a * a003415(a)
end
def a268398(n)
sum = 0
(1..n).map { |n| sum += a003415(n).gcd(n) }.last
end
(PARI) a085731(n) = {my(f = factor(n)); for (i=1, #f~, if (f[i, 2] % f[i, 1], f[i, 2]--); ); factorback(f); }
a(n) = sum(k=1, n, a085731(k)); \\ Michel Marcus, Feb 14 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Kagey, Feb 03 2016
STATUS
approved