OFFSET
1,2
COMMENTS
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{k=1..n} k*( floor(n^k/k)-floor((n^k - 1)/k) ). - Anthony Browne, May 25 2016
a(n) = Sum_{j=1..n} Sum_{i=j..gcd(n^j,j)} i. - Wesley Ivan Hurt, Apr 05 2021
EXAMPLE
MATHEMATICA
Table[Total@ Union[{1}, Function[d, Select[Range@ n, Union[d, First /@ FactorInteger@ #] == d &]][First /@ FactorInteger@ n]], {n, 68}] (* or *)
Table[Sum[k (Floor[n^k/k] - Floor[(n^k - 1)/k]), {k, n}], {n, 68}] (* Michael De Vlieger, May 26 2016 *)
PROG
(PARI) a(n) = {summ = 0; spn = factor(n)[, 1]~; for (m=1, n, spm = factor(m)[, 1]~; if (setintersect(spm, spn) == spm, summ += m); ); summ; } \\ Michel Marcus, Jul 17 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael De Vlieger, Jul 08 2014
STATUS
approved