Skip to main content
6 of 8
added 88 characters in body
H.PWiz
  • 11.7k
  • 2
  • 23
  • 57

Haskell, 61 60 50 48 46 bytes

-2 bytes thanks to xnor

f n=maximum[a*|k<-[2..n],a<-[1..n],n`mod`k^a<1] 

Try it online!

###45 bytes with an import:

import NumberTheory maximum.map snd.factorize 

Try it Online!

H.PWiz
  • 11.7k
  • 2
  • 23
  • 57