Phi Euler

Euler's totient function counts the positive integers up to a given integer n that are relatively prime to nLaTeXn. Formally, it can be defined as the number of integers k in the range 1kn for which gcd(n,k)=1.

Euler's product formula states

φ(n)=np|n1-1p

For a prime number p and for an integer kLaTeXk, this expression reduces to

φ(pk)=pk1-1p

Syntax

phi_euler(Integer)

Description

Given an integer nLaTeXn, returns φ(n).

arithmetic.phi_euler.calc.png