A359612 Largest prime factor with minimal exponent in canonical prime factorization of n.
2, 3, 2, 5, 3, 7, 2, 3, 5, 11, 3, 13, 7, 5, 2, 17, 2, 19, 5, 7, 11, 23, 3, 5, 13, 3, 7, 29, 5, 31, 2, 11, 17, 7, 3, 37, 19, 13, 5, 41, 7, 43, 11, 5, 23, 47, 3, 7, 2, 17, 13, 53, 2, 11, 7, 19, 29, 59, 5, 61, 31, 7, 2, 13, 11, 67, 17, 23, 7, 71, 3, 73, 37, 3
Offset: 2
Keywords
Examples
a(162) = a(2^1 * 3^4) = 2. a(225) = a(3^2 * 5^2) = 5.
Links
- Alois P. Heinz, Table of n, a(n) for n = 2..20000
Programs
-
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 *)
-
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
-
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
Comments