13. Legrendre's Formula | R Documentation |
Given a positive integer n
and a prime p
, the Legendre's Formula finds the largest integer x
such that p^x
divides the factorial of n
, n!
.
Legendre(n, p)
## Default S3 method:
Legendre(n, p)
## S3 method for class 'numeric'
Legendre(n, p)
## S3 method for class 'vli'
Legendre(n, p)
n |
a positive integer; object of class vli or 32 bits integer |
p |
a prime number; object of class vli or 32 bits integer |
object of class vli
Javier Leiva Cuadrado
p <- as.vli(577)
is.prime(p)
Legendre(12222, p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.