OFFSET
1,2
COMMENTS
LINKS
FORMULA
PROG
(PARI)
up_to = 2^18;
LCMtransform(v) = { my(len = length(v), b = vector(len), g = vector(len)); b[1] = g[1] = 1; for(n=2, len, g[n] = lcm(g[n-1], v[n]); b[n] = g[n]/g[n-1]); (b); };
A122111(n) = if(1==n, n, my(f=factor(n), es=Vecrev(f[, 2]), is=concat(apply(primepi, Vecrev(f[, 1])), [0]), pri=0, m=1); for(i=1, #es, pri += es[i]; m *= prime(pri)^(is[i]-is[1+i])); (m));
v369031 = LCMtransform(vector(up_to, i, A122111(i)));
A369031(n) = v369031[n];
(PARI) A369031(n) = if(isprime(n), 2, my(e=ispower(n, , &n)); if(e && isprime(n), prime(e), 1));
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 12 2024
STATUS
approved