OFFSET
1,2
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1000
FORMULA
a(p^s) = lcm(p*(p^(2*s) - 1), p - 1); if gcd(m,n)=1 then a(n*m) = lcm(a(n), a(m)).
MATHEMATICA
ex[p_, s_] := LCM[p(p^(2 s) - 1), p - 1]; ex[1] := 1; ex[n_] := {aux = 1; Do[aux = LCM[aux, ex[fa[n][[i, 1]], fa[n][[i, 2]]]], {i, 1, Length[fa[n]]}]; aux}[[1]]; Table[ex[n], {n, 1, 111}]
PROG
(PARI) a(n)=if(n==1, return(1)); my(f=factor(n)); lcm(vector(#f~, i, f[i, 1]*lcm((f[i, 1]^(2*f[i, 2])-1), f[i, 1]-1))) \\ Charles R Greathouse IV, Nov 13 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
José María Grau Ribas, Nov 02 2013
STATUS
approved