13. Legrendre's Formula {VeryLargeIntegers}R Documentation

Legrendre's Formula for vli Objects

Description

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!.

Usage

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)

Arguments

n

a positive integer; object of class vli or 32 bits integer

p

a prime number; object of class vli or 32 bits integer

Value

object of class vli

Author(s)

Javier Leiva Cuadrado

Examples

p <- as.vli(577)
is.prime(p)
Legendre(12222, p)

[Package VeryLargeIntegers version 0.2.1 Index]