GO Solution For UVa 10179 - Irreducable Basic Fractions. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

A fraction mn is basic if 0 ≤ m < n and it is irreducible if gcd(m,n) = 1. Given a positive integer n, in this problem you are required to find out the number of irreducible basic fractions with denominator n.

For example, the set of all basic fractions with denominator 12, before reduction to lowe

...

You can find the full details of the problem Irreducable Basic Fractions at UVa Online Judge

Sample Input

12
123456
7654321
0

Sample Output

4
41088
7251444

Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985