OFFSET
2,1
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..20000
EXAMPLE
a(162) = a(2^1 * 3^4) = 2.
a(225) = a(3^2 * 5^2) = 5.
MAPLE
a:= n-> (l-> (m-> max(map(i-> i[1], select(y->y[2]=m,
l))))(min(map(x-> x[2], l))))(ifactors(n)[2]):
seq(a(n), n=2..75); # Alois P. Heinz, Jan 25 2023
MATHEMATICA
a[n_] := Module[{f = FactorInteger[n], e, ind}, e = f[[;; , 2]]; ind = Position[e, Min[e]][[-1, 1]]; f[[ind, 1]]]; Array[a, 100, 2] (* Amiram Eldar, Jan 07 2023 *)
PROG
(Python)
from sympy import factorint
def a(n):
max_factor = 0
min_exponent = float("inf")
for p, exponent in factorint(n).items():
if exponent < min_exponent:
max_factor = p
min_exponent = exponent
elif exponent == min_exponent:
max_factor = max(max_factor, p)
return max_factor
(Python)
from sympy import factorint
def A359612(n): return (f:=list(map(tuple, zip(*sorted(factorint(n).items(), reverse=True)))))[0][f[1].index(min(f[1]))] # Chai Wah Wu, Feb 07 2023
(PARI) a(n) = my(f=factor(n), e=vecmin(f[, 2])); f[vecmax(select(x->(x==e), f[, 2], 1)), 1]; \\ Michel Marcus, Jan 26 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Jens Ahlström, Jan 06 2023
STATUS
approved