Skip to main content
deleted 12 characters in body
Source Link
Erik the Outgolfer
  • 40.8k
  • 5
  • 46
  • 125

Python 2, 8178 bytes

n=input() e=m=0 f=2 while~-n: if n%f:f+=1;e=0 else:e+=1;m=maxq=n%f<1;f+=1-q;e=q*-~e;m=max(m,e);n/=f=f**q print m 

Try it online!Try it online!

-25 thanks to ovs.

This answer doesn't do prime checks. Instead, it takes advantage of the fact that the highest exponent of a prime factor will be greater than or equal to the exponent of any other factor in any factorization of a number.

Python 2, 81 bytes

n=input() e=m=0 f=2 while~-n: if n%f:f+=1;e=0 else:e+=1;m=max(m,e);n/=f print m 

Try it online!

-2 thanks to ovs.

This answer doesn't do prime checks. Instead, it takes advantage of the fact that the highest exponent of a prime factor will be greater than or equal to the exponent of any other factor in any factorization of a number.

Python 2, 78 bytes

n=input() e=m=0 f=2 while~-n:q=n%f<1;f+=1-q;e=q*-~e;m=max(m,e);n/=f**q print m 

Try it online!

-5 thanks to ovs.

This answer doesn't do prime checks. Instead, it takes advantage of the fact that the highest exponent of a prime factor will be greater than or equal to the exponent of any other factor in any factorization of a number.

added 69 characters in body
Source Link
Erik the Outgolfer
  • 40.8k
  • 5
  • 46
  • 125

Python 2, 8381 bytes

n=input() e=m=0 f=2 while~-n: if n%f<1n%f:f+=1;e=0 else:e+=1;m=max(m,e);n/=f  else:f+=1;e=0 print m 

Try it online!Try it online!

-2 thanks to ovs.

This answer doesn't do prime checks. Instead, it takes advantage of the fact that the highest exponent of a prime factor will be greater than or equal to the exponent of any other factor in any factorization of a number.

Python 2, 83 bytes

n=input() e=m=0 f=2 while~-n: if n%f<1:e+=1;m=max(m,e);n/=f  else:f+=1;e=0 print m 

Try it online!

This answer doesn't do prime checks. Instead, it takes advantage of the fact that the highest exponent of a prime factor will be greater than or equal to the exponent of any other factor in any factorization of a number.

Python 2, 81 bytes

n=input() e=m=0 f=2 while~-n: if n%f:f+=1;e=0 else:e+=1;m=max(m,e);n/=f print m 

Try it online!

-2 thanks to ovs.

This answer doesn't do prime checks. Instead, it takes advantage of the fact that the highest exponent of a prime factor will be greater than or equal to the exponent of any other factor in any factorization of a number.

Source Link
Erik the Outgolfer
  • 40.8k
  • 5
  • 46
  • 125

Python 2, 83 bytes

n=input() e=m=0 f=2 while~-n: if n%f<1:e+=1;m=max(m,e);n/=f else:f+=1;e=0 print m 

Try it online!

This answer doesn't do prime checks. Instead, it takes advantage of the fact that the highest exponent of a prime factor will be greater than or equal to the exponent of any other factor in any factorization of a number.