OFFSET
1,2
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
FORMULA
a(n) <= n.
a(p) = p, for p prime.
Suppose n>1 and p = A020639(n). a(n) = n if p^2 does not divide n and a(n) = n/p otherwise. - Chai Wah Wu, Apr 04 2024
MATHEMATICA
Join[{1}, Map[LCM[#[[2]], #[[-2]]] &, Divisors[Range[2, 100]]]]
PROG
(PARI) a(n) = if (n==1, 1, my(x=factor(n)[1, 1]); lcm(x, n/x)); \\ Michel Marcus, Apr 02 2024
(Python)
from math import lcm
from sympy import factorint
def a(n): return 1 if n==1 else lcm((p:=min(factorint(n))), n//p)
print([a(n) for n in range(1, 70)]) # Michael S. Branicky, Apr 04 2024
(Python)
from sympy import factorint
def A371573(n): return n if (p:=min(factorint(n).items(), default=(1, 1)))[1] == 1 else n//p[0] # Chai Wah Wu, Apr 04 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paolo Xausa, Mar 30 2024
STATUS
approved