Euler's Totient Function

24 Nov 2019

Problem

Given a number N, calculate the count of numbers in {1, 2, 3,…, N} that are relatively prime to N.

Solution

Euler’s Totient Function

Image

Algorithm is as follows-

Reference - geeksforgeeks
Take note