Finding Irreducible Basic Fractions with Denominator n

  • Thread starter s_chaursia
  • Start date
In summary, the problem is asking for a program or function to find the number of irreducible basic fractions with a given denominator, where a fraction is considered basic if the numerator is between 0 and the denominator and the fraction is irreducible if the greatest common divisor of the numerator and denominator is 1. The input is a positive integer n and the output is the number of irreducible basic fractions with denominator n. The problem can be solved using the Euler phi function, which calculates the number of positive integers less than n that are relatively prime to n.
  • #1
s_chaursia
3
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
  • #2
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"?
 
  • #3
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
 

What is the definition of an irreducible basic fraction with denominator n?

An irreducible basic fraction with denominator n is a fraction where the numerator and denominator have no common factors other than 1, and the denominator is a positive integer n.

How do you find irreducible basic fractions with denominator n?

To find irreducible basic fractions with denominator n, you need to start by listing all the possible fractions with denominator n. Then, simplify each fraction by dividing both the numerator and denominator by their greatest common factor. The resulting fractions will be the irreducible basic fractions with denominator n.

Why is it important to find irreducible basic fractions with denominator n?

It is important to find irreducible basic fractions with denominator n because they represent the simplest form of a fraction. They are useful in various mathematical operations, as well as in real-life situations, such as calculating proportions and ratios.

Can there be more than one irreducible basic fraction with the same denominator n?

Yes, there can be more than one irreducible basic fraction with the same denominator n. For example, the fractions 2/4 and 1/2 are both irreducible basic fractions with denominator 4.

What is the difference between an irreducible basic fraction and a simplified fraction?

An irreducible basic fraction is a fraction where the numerator and denominator have no common factors other than 1, while a simplified fraction is a fraction where the numerator and denominator have been divided by their greatest common factor. A simplified fraction may or may not be an irreducible basic fraction, depending on whether there are any common factors remaining after simplification.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
  • Programming and Computer Science
Replies
29
Views
1K
  • Calculus and Beyond Homework Help
Replies
11
Views
2K
  • Electrical Engineering
Replies
4
Views
839
  • Programming and Computer Science
Replies
25
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
21
Views
2K
  • Science Fiction and Fantasy Media
Replies
0
Views
991
Replies
2
Views
2K
Back
Top