login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A268398
Partial sums of A085731.
2
1, 2, 3, 7, 8, 9, 10, 14, 17, 18, 19, 23, 24, 25, 26, 42, 43, 46, 47, 51, 52, 53, 54, 58, 63, 64, 91, 95, 96, 97, 98, 114, 115, 116, 117, 129, 130, 131, 132, 136, 137, 138, 139, 143, 146, 147, 148, 164, 171, 176, 177, 181, 182, 209, 210, 214, 215, 216, 217
OFFSET
1,2
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
Sequence in context: A047361 A037461 A284514 * A249587 A007607 A370902
KEYWORD
nonn
AUTHOR
Peter Kagey, Feb 03 2016
STATUS
approved