Finding Irreducible Basic Fractions with Denominator n

  • Context: Undergrad 
  • Thread starter Thread starter s_chaursia
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on finding the number of irreducible basic fractions with a given denominator n, defined as fractions m/n where 0 <= m < n and gcd(m, n) = 1. The Euler's Totient Function, φ(n), is identified as the key mathematical tool to determine the count of such fractions. Sample inputs include 12, 123456, and 7654321, yielding outputs of 4, 41088, and 7251444 respectively. The conversation emphasizes the importance of implementing a computer program to automate this calculation.

PREREQUISITES
  • Understanding of basic fraction concepts and properties
  • Knowledge of the Greatest Common Divisor (gcd)
  • Familiarity with Euler's Totient Function (φ(n))
  • Basic programming skills to implement a solution
NEXT STEPS
  • Research the implementation of Euler's Totient Function in programming languages
  • Learn about algorithms for calculating gcd efficiently
  • Explore optimization techniques for handling large integers in computations
  • Investigate mathematical properties of irreducible fractions
USEFUL FOR

Mathematicians, computer scientists, and programmers interested in number theory and algorithm development for calculating irreducible fractions.

s_chaursia
Messages
3
Reaction score
0
A fraction m / n 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
lowest terms, is
Reduction yields
Hence there are only the following 4 irreducible basic fractions with denominator 12
Input
Each line of the input contains a positive integer n (< 1000000000) and the input
terminates with a value 0 for n (do not process this terminating value).
Output
For each n in the input print a line containing the number of irreducible basic fractions with
denominator n
Sample Input
12
123456
7654321
0
Sample Output
4
41088
7251444
 
Physics news on Phys.org
This makes no sense at all. Are you asking for a computer program to do that? If not, what do you mean by "input" and "output"?
 
Well, computer program are usually easier math problems :) I believe he wants a computer program, but you can challenge yourself by finding a function f(x) such that it returns the number of irreducible basic fractions with denominator x.

It looks like a fraction is simple if you can write m/n where gcd(m,n) = 1 and 0<m<n. Well if that is the case, then you're just looking for how many positive numbers are relatively prime to n that are less than n..

If so, look up the euler phi function..
http://en.wikipedia.org/wiki/Euler's_totient_function
 

Similar threads

Replies
48
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 29 ·
Replies
29
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
8
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K