ordpn | R Documentation |
Calculates the order of a prime number p
in n!
, i.e. the
highest exponent e
such that p^e|n!
.
ordpn(p, n)
p |
prime number. |
n |
natural number. |
Applies the well-known formula adding terms floor(n/p^k)
.
Returns the exponent e
.
ordpn(2, 100) #=> 97 ordpn(7, 100) #=> 16 ordpn(101, 100) #=> 0 ordpn(997, 1000) #=> 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.