A261969 Product of primes dividing n with maximum multiplicity.
1, 2, 3, 2, 5, 6, 7, 2, 3, 10, 11, 2, 13, 14, 15, 2, 17, 3, 19, 2, 21, 22, 23, 2, 5, 26, 3, 2, 29, 30, 31, 2, 33, 34, 35, 6, 37, 38, 39, 2, 41, 42, 43, 2, 3, 46, 47, 2, 7, 5, 51, 2, 53, 3, 55, 2, 57, 58, 59, 2, 61, 62, 3, 2, 65, 66, 67, 2, 69, 70, 71, 2, 73, 74, 5, 2, 77, 78, 79, 2, 3, 82, 83, 2, 85, 86, 87, 2, 89, 3, 91
Offset: 1
Keywords
Examples
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.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
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
-
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 *)
-
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
Comments