              There is a fine line between numerator and denominator.       ─── anonymous



A method to   "reduce"   some reducible fractions is to   cross out   a digit from the
numerator and the denominator.   An example is:

       16                                                  16
      ────     and then (simply) cross─out the sixes:      ────
       64                                                  64

resulting in:

        1
       ───    
        4



Naturally,   this "method" of reduction must reduce to the proper value   (shown as a fraction).

This "method" is also known as   anomalous cancellation   and also   accidental cancellation.



(Of course,   this "method" shouldn't be taught to impressionable or gullible minds.)        😇 



Task

Find and show some fractions that can be reduced by the above "method".

   show 2-digit fractions found   (like the example shown above)
   show 3-digit fractions
   show 4-digit fractions
   show 5-digit fractions   (and higher)       (optional)
   show each (above) n-digit fractions separately from other different n-sized fractions, don't mix different "sizes" together
   for each "size" fraction,   only show a dozen examples   (the 1st twelve found)
   (it's recognized that not every programming solution will have the same generation algorithm)
   for each "size" fraction:
   show a count of how many reducible fractions were found.   The example (above) is size 2
   show a count of which digits were crossed out   (one line for each different digit)
   for each "size" fraction,   show a count of how many were found.   The example (above) is size 2
   show each n-digit example   (to be shown on one line):
   show each n-digit fraction
   show each reduced n-digit fraction
   show what digit was crossed out for the numerator and the denominator


Task requirements/restrictions

   only proper fractions and their reductions   (the result)   are to be used   (no vulgar fractions)
   only positive fractions are to be used   (no negative signs anywhere)
   only base ten integers are to be used for the numerator and denominator
   no zeros   (decimal digit)   can be used within the numerator or the denominator
   the numerator and denominator should be composed of the same number of digits
   no digit can be repeated in the numerator
   no digit can be repeated in the denominator
   (naturally)   there should be a shared decimal digit in the numerator   and   the denominator
   fractions can be shown as   16/64   (for example)


Show all output here, on this page.



Somewhat related task

   Farey sequence       (It concerns fractions.) 


References

   Wikipedia entry:   proper and improper fractions.
   Wikipedia entry:   anomalous cancellation and/or accidental cancellation.


Module Module1
 
    Function IndexOf(n As Integer, s As Integer()) As Integer
        For ii = 1 To s.Length
            Dim i = ii - 1
            If s(i) = n Then
                Return i
            End If
        Next
        Return -1
    End Function
 
    Function GetDigits(n As Integer, le As Integer, digits As Integer()) As Boolean
        While n > 0
            Dim r = n Mod 10
            If r = 0 OrElse IndexOf(r, digits) >= 0 Then
                Return False
            End If
            le -= 1
            digits(le) = r
            n \= 10
        End While
        Return True
    End Function
 
    Function RemoveDigit(digits As Integer(), le As Integer, idx As Integer) As Integer
        Dim pows = {1, 10, 100, 1000, 10000}
        Dim sum = 0
        Dim pow = pows(le - 2)
        For ii = 1 To le
            Dim i = ii - 1
            If i = idx Then
                Continue For
            End If
            sum += digits(i) * pow
            pow \= 10
        Next
        Return sum
    End Function
 
    Sub Main()
        Dim lims = {{12, 97}, {123, 986}, {1234, 9875}, {12345, 98764}}
        Dim count(5) As Integer
        Dim omitted(5, 10) As Integer
        Dim upperBound = lims.GetLength(0)
        For ii = 1 To upperBound
            Dim i = ii - 1
            Dim nDigits(i + 2 - 1) As Integer
            Dim dDigits(i + 2 - 1) As Integer
            Dim blank(i + 2 - 1) As Integer
            For n = lims(i, 0) To lims(i, 1)
                blank.CopyTo(nDigits, 0)
                Dim nOk = GetDigits(n, i + 2, nDigits)
                If Not nOk Then
                    Continue For
                End If
                For d = n + 1 To lims(i, 1) + 1
                    blank.CopyTo(dDigits, 0)
                    Dim dOk = GetDigits(d, i + 2, dDigits)
                    If Not dOk Then
                        Continue For
                    End If
                    For nixt = 1 To nDigits.Length
                        Dim nix = nixt - 1
                        Dim digit = nDigits(nix)
                        Dim dix = IndexOf(digit, dDigits)
                        If dix >= 0 Then
                            Dim rn = RemoveDigit(nDigits, i + 2, nix)
                            Dim rd = RemoveDigit(dDigits, i + 2, dix)
                            If (n / d) = (rn / rd) Then
                                count(i) += 1
                                omitted(i, digit) += 1
                                If count(i) <= 12 Then
                                    Console.WriteLine("{0}/{1} = {2}/{3} by omitting {4}'s", n, d, rn, rd, digit)
                                End If
                            End If
                        End If
                    Next
                Next
            Next
            Console.WriteLine()
        Next
 
        For i = 2 To 5
            Console.WriteLine("There are {0} {1}-digit fractions of which:", count(i - 2), i)
            For j = 1 To 9
                If omitted(i - 2, j) = 0 Then
                    Continue For
                End If
                Console.WriteLine("{0,6} have {1}'s omitted", omitted(i - 2, j), j)
            Next
            Console.WriteLine()
        Next
    End Sub
 
End Module