A
A
andrey_levushkin2019-04-12 12:29:58
Pascal
andrey_levushkin, 2019-04-12 12:29:58

How to find all simple irreducible fractions less than 1 whose denominators do not exceed 9?

How to find all simple irreducible fractions less than 1 whose denominators do not exceed 9?
A fraction is given by two natural numbers - the numerator and the denominator.
It seems to have made a sketch, but such fractions as 2/4 2/6 3/6 4/6 2/8 4/8 6/8 slip
through. How to get rid of them?

var    chisl,znam: integer;
begin
  
  for znam:=2 to 9 do begin
    for chisl:= 1 to znam do 
        if (chisl mod znam <>0) then write (chisl,'/',znam,' ');
      writeln();
      end
    
end.

5cb05a92def52955888642.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question