Reducing fractions the wrong way
In this code-golf challenge you have to find fractions that can be reduced the wrong way but still end up in the same number.
Note: reducing fractions the wrong way does here have an exact definition, see details.
64/1 6=4/1 = 4
Of course you cannot just strike both 6es but here you still end up with the correct value. In this challenge you have to find examples like this.
You have to write a function/program that accepts one positive integer
n as input and outputs/returns a list/array of the fractions in format
The program has to find out for each fraction
a,b>0 whether it can be reduced the wrong way. (It does not matter whether if it can be reduced in the conventional way or whether there are many possibilities of reductions, it just has to be possible to reduce it the wrong way in at least one way.)
Definition of the wrong way: A fraction can be reduced the wrong way if and only if the same sequence of successive digits appears in a and b and if the value of the fraction stays the same if you remove the substring.
Example: 1536/353 can be 'reduced' to 16/3 but those two values are not equal so you cannot reduce this fraction the wrong way.
Note that this definition of reducing the wrong way can also include fractions that are reduced the right way:
110/10 = 11/1 is within the definition of reducing the wrong way even though it is a valid step.
The least number of bytes wins. You can write a function or program that accepts an integer and returns an array or a program that uses stdin/stdout or you can consider n saved in a variable and in the end of the program the list must be saved in an other variable.
Please include following testcases (Tell me which ones I should add, I have no idea how many of those fractions there are / how many examples to expect)
n=80 (64/16 should be in this list) n=147 (98/49 should be in this list) n=500 (294/196 should be in this list) WRONG since 294+196 != 500 Thanks Falko
1010/10 = 101/1 && 1010/10 /= 110/1\$\endgroup\$
n=147) is incorrect:
49/89 != 4/8. \$\endgroup\$