OFFSET
1,2
COMMENTS
a(1) = 1 by convention.
If n is prime then a(n) = n; e.g., a(2) = 2, a(3) = 3, a(5) = 5, etc. Also if n is nonsquare semiprime then a(n) = n; e.g., a(6) = 6, a(10) = 10, a(14) = 14, a(15) = 15, etc. - Zak Seidov, Sep 07 2015
a(n)= n precisely when n is squarefree. - Franklin T. Adams-Watters, Feb 16 2019
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
EXAMPLE
18 = 2^1 * 3^2. 2 is the maximum exponent, 3 is the only prime with that exponent, so a(18) = 3.
36 = 2^2 * 3^2, maximum exponent 2 for both 2 and 3, so a(36) = 2*3 = 6.
MAPLE
a:= n-> (l->(m->mul(`if`(m=j[2], j[1], 1), j=l))(
max(seq(i[2], i=l))))(ifactors(n)[2]):
seq(a(n), n=1..100); # Alois P. Heinz, Sep 07 2015
MATHEMATICA
f[n_] := Block[{pf = FactorInteger@ n}, Times @@ Take[First /@ pf, Flatten@ Position[Last /@ pf, Max[Last /@ pf]]]]; f /@ Range@ 91 (* Michael De Vlieger, Sep 07 2015 *)
PROG
(PARI) a(n) = my(fm=factor(n), m); if(n<2, return(n)); m=vecmax(fm[, 2]~); prod(k=1, #fm[, 2]~, if(fm[k, 2]==m, fm[k, 1], 1))
(PARI) a(n) = {my(f = factor(n)); if (n>1, m = vecmax(f[, 2])); for (i=1, #f~, f[i, 2] = (f[i, 2]==m)); factorback(f); } \\ Michel Marcus, Sep 08 2015
(Haskell)
a261969 n = product $ map fst $ filter ((== emax) . snd) $ zip ps es
where emax = maximum es
ps = a027748_row n; es = a124010_row n
-- Reinhard Zumkeller, Sep 08 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Franklin T. Adams-Watters, Sep 07 2015
STATUS
approved