human
Legendre 's formula (Given p and n, find the largest x such that p^x divides n!) | Returns largest power of p that divides n !.
Initialize result.
Calculate x = n / p + n / ( p ^ 2 ) + n / ( p ^ 3 ) + ... ..
Driver program"
Solution in Python:

=====
Can you provide a code to legendre 's formula (Given p and n, find the largest x such that p^x divides n!) and the other steps required?
assistant
#Here is code to legendre 's formula (Given p and n, find the largest x such that p^x divides n!) and the other steps required.
 def largestPower ( n , p ) :
	x = 0
	while n :
		n /= p
		x += n
	return x
n = 10 ; p = 3
print ( " The largest power of % d that divides % d ! is % d " % ( p , n , largestPower ( n , p ) ) )