Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A359612
Largest prime factor with minimal exponent in canonical prime factorization of n.
3
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,1
COMMENTS
When inspecting the minimal exponent of the canonical representation of n, a(n) is the largest of those primes, while A067695(n) is the smallest.
On the other hand if the maximal exponent is regarded similarly, A356840(n) is the largest of those primes and A356838(n) is the smallest.
18 is the smallest n, where a(n) differs from A006530(n), since a(18) = 2, while A006530(18) = 3.
LINKS
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