OFFSET
1,2
LINKS
FORMULA
MATHEMATICA
a[n_] := If[n == 1, 1, Module[{p, e}, LCM @@ Table[{p, e} = pe;
(p^(e + If[p == 2, 1, 0])) - 1, {pe, FactorInteger[n]}]]];
Array[a, 100] (* Jean-François Alcover, Jun 12 2021 *)
PROG
(PARI) A344878(n) = if(1==n, n, my(f=factor(n)~); lcm(vector(#f, i, (f[1, i]^(f[2, i]+(2==f[1, i]))-1))));
(Python)
from math import lcm
from sympy import factorint
def A344878(n): return lcm(*(p**(e+int(p==2))-1 for p, e in factorint(n).items())) # Chai Wah Wu, Jun 15 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 03 2021
STATUS
approved