In [1]:
from __future__ import division
In [2]:
a = range(0, 10)
b = range(0, 10)
c = range(0, 10)
d = range(0, 10)
In [3]:
print a
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
In [4]:
count = 0
for ai in a:
    for bi in b:
        for ci in c:
            for di in d:
                if ai == 0 or bi == 0 or ci == 0 or di == 0:
                    continue;
                else:
                    x = ai*ci
                    y = bi*di
                    res = x/y
                    xx = ai*10 + ci
                    yy = bi*10 + di
                    res2 = xx/yy
                    if res == res2:
                        count += 1
                        print str(count)+'.   (', ai, '/', bi, ') x (', ci, '/', di, ') = ' , res, ' = ', xx, '/', yy
1.   ( 1 / 1 ) x ( 1 / 1 ) =  1.0  =  11 / 11
2.   ( 1 / 1 ) x ( 2 / 2 ) =  1.0  =  12 / 12
3.   ( 1 / 1 ) x ( 3 / 3 ) =  1.0  =  13 / 13
4.   ( 1 / 1 ) x ( 4 / 4 ) =  1.0  =  14 / 14
5.   ( 1 / 1 ) x ( 5 / 5 ) =  1.0  =  15 / 15
6.   ( 1 / 1 ) x ( 6 / 6 ) =  1.0  =  16 / 16
7.   ( 1 / 1 ) x ( 7 / 7 ) =  1.0  =  17 / 17
8.   ( 1 / 1 ) x ( 8 / 8 ) =  1.0  =  18 / 18
9.   ( 1 / 1 ) x ( 9 / 9 ) =  1.0  =  19 / 19
10.   ( 1 / 2 ) x ( 5 / 4 ) =  0.625  =  15 / 24
11.   ( 1 / 4 ) x ( 8 / 5 ) =  0.4  =  18 / 45
12.   ( 1 / 6 ) x ( 4 / 3 ) =  0.222222222222  =  14 / 63
13.   ( 1 / 6 ) x ( 6 / 4 ) =  0.25  =  16 / 64
14.   ( 1 / 9 ) x ( 9 / 5 ) =  0.2  =  19 / 95
15.   ( 2 / 1 ) x ( 4 / 5 ) =  1.6  =  24 / 15
16.   ( 2 / 2 ) x ( 1 / 1 ) =  1.0  =  21 / 21
17.   ( 2 / 2 ) x ( 2 / 2 ) =  1.0  =  22 / 22
18.   ( 2 / 2 ) x ( 3 / 3 ) =  1.0  =  23 / 23
19.   ( 2 / 2 ) x ( 4 / 4 ) =  1.0  =  24 / 24
20.   ( 2 / 2 ) x ( 5 / 5 ) =  1.0  =  25 / 25
21.   ( 2 / 2 ) x ( 6 / 6 ) =  1.0  =  26 / 26
22.   ( 2 / 2 ) x ( 7 / 7 ) =  1.0  =  27 / 27
23.   ( 2 / 2 ) x ( 8 / 8 ) =  1.0  =  28 / 28
24.   ( 2 / 2 ) x ( 9 / 9 ) =  1.0  =  29 / 29
25.   ( 2 / 6 ) x ( 6 / 5 ) =  0.4  =  26 / 65
26.   ( 3 / 3 ) x ( 1 / 1 ) =  1.0  =  31 / 31
27.   ( 3 / 3 ) x ( 2 / 2 ) =  1.0  =  32 / 32
28.   ( 3 / 3 ) x ( 3 / 3 ) =  1.0  =  33 / 33
29.   ( 3 / 3 ) x ( 4 / 4 ) =  1.0  =  34 / 34
30.   ( 3 / 3 ) x ( 5 / 5 ) =  1.0  =  35 / 35
31.   ( 3 / 3 ) x ( 6 / 6 ) =  1.0  =  36 / 36
32.   ( 3 / 3 ) x ( 7 / 7 ) =  1.0  =  37 / 37
33.   ( 3 / 3 ) x ( 8 / 8 ) =  1.0  =  38 / 38
34.   ( 3 / 3 ) x ( 9 / 9 ) =  1.0  =  39 / 39
35.   ( 4 / 1 ) x ( 5 / 8 ) =  2.5  =  45 / 18
36.   ( 4 / 4 ) x ( 1 / 1 ) =  1.0  =  41 / 41
37.   ( 4 / 4 ) x ( 2 / 2 ) =  1.0  =  42 / 42
38.   ( 4 / 4 ) x ( 3 / 3 ) =  1.0  =  43 / 43
39.   ( 4 / 4 ) x ( 4 / 4 ) =  1.0  =  44 / 44
40.   ( 4 / 4 ) x ( 5 / 5 ) =  1.0  =  45 / 45
41.   ( 4 / 4 ) x ( 6 / 6 ) =  1.0  =  46 / 46
42.   ( 4 / 4 ) x ( 7 / 7 ) =  1.0  =  47 / 47
43.   ( 4 / 4 ) x ( 8 / 8 ) =  1.0  =  48 / 48
44.   ( 4 / 4 ) x ( 9 / 9 ) =  1.0  =  49 / 49
45.   ( 4 / 9 ) x ( 9 / 8 ) =  0.5  =  49 / 98
46.   ( 5 / 5 ) x ( 1 / 1 ) =  1.0  =  51 / 51
47.   ( 5 / 5 ) x ( 2 / 2 ) =  1.0  =  52 / 52
48.   ( 5 / 5 ) x ( 3 / 3 ) =  1.0  =  53 / 53
49.   ( 5 / 5 ) x ( 4 / 4 ) =  1.0  =  54 / 54
50.   ( 5 / 5 ) x ( 5 / 5 ) =  1.0  =  55 / 55
51.   ( 5 / 5 ) x ( 6 / 6 ) =  1.0  =  56 / 56
52.   ( 5 / 5 ) x ( 7 / 7 ) =  1.0  =  57 / 57
53.   ( 5 / 5 ) x ( 8 / 8 ) =  1.0  =  58 / 58
54.   ( 5 / 5 ) x ( 9 / 9 ) =  1.0  =  59 / 59
55.   ( 6 / 1 ) x ( 3 / 4 ) =  4.5  =  63 / 14
56.   ( 6 / 1 ) x ( 4 / 6 ) =  4.0  =  64 / 16
57.   ( 6 / 2 ) x ( 5 / 6 ) =  2.5  =  65 / 26
58.   ( 6 / 6 ) x ( 1 / 1 ) =  1.0  =  61 / 61
59.   ( 6 / 6 ) x ( 2 / 2 ) =  1.0  =  62 / 62
60.   ( 6 / 6 ) x ( 3 / 3 ) =  1.0  =  63 / 63
61.   ( 6 / 6 ) x ( 4 / 4 ) =  1.0  =  64 / 64
62.   ( 6 / 6 ) x ( 5 / 5 ) =  1.0  =  65 / 65
63.   ( 6 / 6 ) x ( 6 / 6 ) =  1.0  =  66 / 66
64.   ( 6 / 6 ) x ( 7 / 7 ) =  1.0  =  67 / 67
65.   ( 6 / 6 ) x ( 8 / 8 ) =  1.0  =  68 / 68
66.   ( 6 / 6 ) x ( 9 / 9 ) =  1.0  =  69 / 69
67.   ( 7 / 7 ) x ( 1 / 1 ) =  1.0  =  71 / 71
68.   ( 7 / 7 ) x ( 2 / 2 ) =  1.0  =  72 / 72
69.   ( 7 / 7 ) x ( 3 / 3 ) =  1.0  =  73 / 73
70.   ( 7 / 7 ) x ( 4 / 4 ) =  1.0  =  74 / 74
71.   ( 7 / 7 ) x ( 5 / 5 ) =  1.0  =  75 / 75
72.   ( 7 / 7 ) x ( 6 / 6 ) =  1.0  =  76 / 76
73.   ( 7 / 7 ) x ( 7 / 7 ) =  1.0  =  77 / 77
74.   ( 7 / 7 ) x ( 8 / 8 ) =  1.0  =  78 / 78
75.   ( 7 / 7 ) x ( 9 / 9 ) =  1.0  =  79 / 79
76.   ( 8 / 8 ) x ( 1 / 1 ) =  1.0  =  81 / 81
77.   ( 8 / 8 ) x ( 2 / 2 ) =  1.0  =  82 / 82
78.   ( 8 / 8 ) x ( 3 / 3 ) =  1.0  =  83 / 83
79.   ( 8 / 8 ) x ( 4 / 4 ) =  1.0  =  84 / 84
80.   ( 8 / 8 ) x ( 5 / 5 ) =  1.0  =  85 / 85
81.   ( 8 / 8 ) x ( 6 / 6 ) =  1.0  =  86 / 86
82.   ( 8 / 8 ) x ( 7 / 7 ) =  1.0  =  87 / 87
83.   ( 8 / 8 ) x ( 8 / 8 ) =  1.0  =  88 / 88
84.   ( 8 / 8 ) x ( 9 / 9 ) =  1.0  =  89 / 89
85.   ( 9 / 1 ) x ( 5 / 9 ) =  5.0  =  95 / 19
86.   ( 9 / 4 ) x ( 8 / 9 ) =  2.0  =  98 / 49
87.   ( 9 / 9 ) x ( 1 / 1 ) =  1.0  =  91 / 91
88.   ( 9 / 9 ) x ( 2 / 2 ) =  1.0  =  92 / 92
89.   ( 9 / 9 ) x ( 3 / 3 ) =  1.0  =  93 / 93
90.   ( 9 / 9 ) x ( 4 / 4 ) =  1.0  =  94 / 94
91.   ( 9 / 9 ) x ( 5 / 5 ) =  1.0  =  95 / 95
92.   ( 9 / 9 ) x ( 6 / 6 ) =  1.0  =  96 / 96
93.   ( 9 / 9 ) x ( 7 / 7 ) =  1.0  =  97 / 97
94.   ( 9 / 9 ) x ( 8 / 8 ) =  1.0  =  98 / 98
95.   ( 9 / 9 ) x ( 9 / 9 ) =  1.0  =  99 / 99
In [ ]: