OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Paolo P. Lava)
EXAMPLE
The divisors of 20 are 1, 2, 4, 5, 10, 20 while the least divisors of 20 whose LCM is equal to 20 are 1, 2, 4, 5. Then a(20) = 1+2+4+5 = 12.
MAPLE
with(numtheory);
A222085:=proc(q)
local a, b, c, j, n, v; print(1);
for n from 2 to q do a:=ifactors(n)[2]; b:=nops(a); c:=0;
for j from 1 to b do if a[j][1]^a[j][2]>c then c:=a[j][1]^a[j][2]; fi; od;
a:=op(sort([op(divisors(n))])); b:=nops(divisors(n)); v:=0;
for j from 1 to b do v:=v+a[j]; if a[j]=c then break; fi; od; print(v);
od; end:
A222085(100000000);
MATHEMATICA
s[n_] := Module[{sum=0, L=1}, Do[sum+=d; L = LCM[L, d]; If[L == n, Break[]], {d, Divisors[n]}]; sum]; Array[s, 67] (* Amiram Eldar, Nov 05 2019 *)
PROG
(PARI) a(n)=my(s, L=1); fordiv(n, d, s+=d; L=lcm(L, d); if(L==n, return(s))) \\ Charles R Greathouse IV, Feb 14 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo P. Lava, Feb 11 2013
STATUS
approved