Euler: Euler's Phi Function for vli Objects

17. Euler's phi functionR Documentation

Euler's Phi Function for vli Objects

Description

Euler's Phi Function for vli (Very Large Integers) objects. Given a positive integer x, the Euler's Phi Function returns the number of positive integers up to x that are relatively prime to x.

Usage

phi(x)

## Default S3 method:
phi(x)

## S3 method for class 'numeric'
phi(x)

## S3 method for class 'vli'
phi(x)

Arguments

x

positive integer; object of class vli or 32 bits integer

Details

The returned value by the phi function is equal to the order of the group of units of the ring Z/Zn (the multiplicative group of integers modulo n). It is also called Euler's Totient Function, and plays a major part in Number Theory and in the RSA Cryptosystem.

Value

object of class vli

Author(s)

Javier Leiva Cuadrado

Examples

## Not run: 
x <- as.vli("24352")
phi(x)

## End(Not run)

VeryLargeIntegers documentation built on May 31, 2023, 7:06 p.m.