- def a(n):
- s=[[x,n-x,y,m-y] for m in range(2,n+1) for x in range(1,n) for y in range(1,m) if (x*y)%2==0 and (m*n)%2==0 and m*x==n*y]
- return(n,len(s),s)
- for n in range(1,31):
- print(a(n))
复制代码
(1, 0, [])
(2, 0, [])
(3, 0, [])
(4, 2, [[2, 2, 1, 1], [2, 2, 2, 2]])
(5, 0, [])
(6, 5, [[2, 4, 1, 2], [4, 2, 2, 1], [3, 3, 2, 2], [2, 4, 2, 4], [4, 2, 4, 2]])
(7, 0, [])
(8, 8, [[4, 4, 1, 1], [2, 6, 1, 3], [4, 4, 2, 2], [6, 2, 3, 1], [4, 4, 3, 3], [2, 6, 2, 6], [4, 4, 4, 4], [6, 2, 6, 2]])
(9, 2, [[3, 6, 2, 4], [6, 3, 4, 2]])
(10, 10, [[5, 5, 2, 2], [2, 8, 1, 4], [4, 6, 2, 3], [6, 4, 3, 2], [8, 2, 4, 1], [5, 5, 4, 4], [2, 8, 2, 8], [4, 6, 4, 6], [6, 4, 6, 4], [8, 2, 8, 2]])
(11, 0, [])
(12, 20, [[6, 6, 1, 1], [4, 8, 1, 2], [8, 4, 2, 1], [6, 6, 2, 2], [2, 10, 1, 5], [4, 8, 2, 4], [6, 6, 3, 3], [8, 4, 4, 2], [10, 2, 5, 1], [3, 9, 2, 6], [6, 6, 4, 4], [9, 3, 6, 2], [4, 8, 3, 6], [8, 4, 6, 3], [6, 6, 5, 5], [2, 10, 2, 10], [4, 8, 4, 8], [6, 6, 6, 6], [8, 4, 8, 4], [10, 2, 10, 2]])
(13, 0, [])
(14, 15, [[7, 7, 2, 2], [2, 12, 1, 6], [4, 10, 2, 5], [6, 8, 3, 4], [8, 6, 4, 3], [10, 4, 5, 2], [12, 2, 6, 1], [7, 7, 4, 4], [7, 7, 6, 6], [2, 12, 2, 12], [4, 10, 4, 10], [6, 8, 6, 8], [8, 6, 8, 6], [10, 4, 10, 4], [12, 2, 12, 2]])
(15, 8, [[5, 10, 2, 4], [10, 5, 4, 2], [3, 12, 2, 8], [6, 9, 4, 6], [9, 6, 6, 4], [12, 3, 8, 2], [5, 10, 4, 8], [10, 5, 8, 4]])
(16, 24, [[8, 8, 1, 1], [4, 12, 1, 3], [8, 8, 2, 2], [12, 4, 3, 1], [8, 8, 3, 3], [2, 14, 1, 7], [4, 12, 2, 6], [6, 10, 3, 5], [8, 8, 4, 4], [10, 6, 5, 3], [12, 4, 6, 2], [14, 2, 7, 1], [8, 8, 5, 5], [4, 12, 3, 9], [8, 8, 6, 6], [12, 4, 9, 3], [8, 8, 7, 7], [2, 14, 2, 14], [4, 12, 4, 12], [6, 10, 6, 10], [8, 8, 8, 8], [10, 6, 10, 6], [12, 4, 12, 4], [14, 2, 14, 2]])
(17, 0, [])
(18, 30, [[6, 12, 1, 2], [12, 6, 2, 1], [9, 9, 2, 2], [6, 12, 2, 4], [12, 6, 4, 2], [9, 9, 4, 4], [2, 16, 1, 8], [4, 14, 2, 7], [6, 12, 3, 6], [8, 10, 4, 5], [10, 8, 5, 4], [12, 6, 6, 3], [14, 4, 7, 2], [16, 2, 8, 1], [3, 15, 2, 10], [6, 12, 4, 8], [9, 9, 6, 6], [12, 6, 8, 4], [15, 3, 10, 2], [6, 12, 5, 10], [12, 6, 10, 5], [9, 9, 8, 8], [2, 16, 2, 16], [4, 14, 4, 14], [6, 12, 6, 12], [8, 10, 8, 10], [10, 8, 10, 8], [12, 6, 12, 6], [14, 4, 14, 4], [16, 2, 16, 2]])
(19, 0, [])
(20, 38, [[10, 10, 1, 1], [10, 10, 2, 2], [4, 16, 1, 4], [8, 12, 2, 3], [12, 8, 3, 2], [16, 4, 4, 1], [10, 10, 3, 3], [5, 15, 2, 6], [10, 10, 4, 4], [15, 5, 6, 2], [2, 18, 1, 9], [4, 16, 2, 8], [6, 14, 3, 7], [8, 12, 4, 6], [10, 10, 5, 5], [12, 8, 6, 4], [14, 6, 7, 3], [16, 4, 8, 2], [18, 2, 9, 1], [10, 10, 6, 6], [10, 10, 7, 7], [4, 16, 3, 12], [8, 12, 6, 9], [12, 8, 9, 6], [16, 4, 12, 3], [5, 15, 4, 12], [10, 10, 8, 8], [15, 5, 12, 4], [10, 10, 9, 9], [2, 18, 2, 18], [4, 16, 4, 16], [6, 14, 6, 14], [8, 12, 8, 12], [10, 10, 10, 10], [12, 8, 12, 8], [14, 6, 14, 6], [16, 4, 16, 4], [18, 2, 18, 2]])
(21, 12, [[7, 14, 2, 4], [14, 7, 4, 2], [7, 14, 4, 8], [14, 7, 8, 4], [3, 18, 2, 12], [6, 15, 4, 10], [9, 12, 6, 8], [12, 9, 8, 6], [15, 6, 10, 4], [18, 3, 12, 2], [7, 14, 6, 12], [14, 7, 12, 6]])
(22, 25, [[11, 11, 2, 2], [11, 11, 4, 4], [2, 20, 1, 10], [4, 18, 2, 9], [6, 16, 3, 8], [8, 14, 4, 7], [10, 12, 5, 6], [12, 10, 6, 5], [14, 8, 7, 4], [16, 6, 8, 3], [18, 4, 9, 2], [20, 2, 10, 1], [11, 11, 6, 6], [11, 11, 8, 8], [11, 11, 10, 10], [2, 20, 2, 20], [4, 18, 4, 18], [6, 16, 6, 16], [8, 14, 8, 14], [10, 12, 10, 12], [12, 10, 12, 10], [14, 8, 14, 8], [16, 6, 16, 6], [18, 4, 18, 4], [20, 2, 20, 2]])
(23, 0, [])
(24, 60, [[12, 12, 1, 1], [8, 16, 1, 2], [16, 8, 2, 1], [6, 18, 1, 3], [12, 12, 2, 2], [18, 6, 3, 1], [4, 20, 1, 5], [8, 16, 2, 4], [12, 12, 3, 3], [16, 8, 4, 2], [20, 4, 5, 1], [6, 18, 2, 6], [12, 12, 4, 4], [18, 6, 6, 2], [8, 16, 3, 6], [16, 8, 6, 3], [12, 12, 5, 5], [2, 22, 1, 11], [4, 20, 2, 10], [6, 18, 3, 9], [8, 16, 4, 8], [10, 14, 5, 7], [12, 12, 6, 6], [14, 10, 7, 5], [16, 8, 8, 4], [18, 6, 9, 3], [20, 4, 10, 2], [22, 2, 11, 1], [12, 12, 7, 7], [8, 16, 5, 10], [16, 8, 10, 5], [3, 21, 2, 14], [6, 18, 4, 12], [9, 15, 6, 10], [12, 12, 8, 8], [15, 9, 10, 6], [18, 6, 12, 4], [21, 3, 14, 2], [4, 20, 3, 15], [8, 16, 6, 12], [12, 12, 9, 9], [16, 8, 12, 6], [20, 4, 15, 3], [6, 18, 5, 15], [12, 12, 10, 10], [18, 6, 15, 5], [8, 16, 7, 14], [16, 8, 14, 7], [12, 12, 11, 11], [2, 22, 2, 22], [4, 20, 4, 20], [6, 18, 6, 18], [8, 16, 8, 16], [10, 14, 10, 14], [12, 12, 12, 12], [14, 10, 14, 10], [16, 8, 16, 8], [18, 6, 18, 6], [20, 4, 20, 4], [22, 2, 22, 2]])
(25, 8, [[5, 20, 2, 8], [10, 15, 4, 6], [15, 10, 6, 4], [20, 5, 8, 2], [5, 20, 4, 16], [10, 15, 8, 12], [15, 10, 12, 8], [20, 5, 16, 4]])
(26, 30, [[13, 13, 2, 2], [13, 13, 4, 4], [13, 13, 6, 6], [2, 24, 1, 12], [4, 22, 2, 11], [6, 20, 3, 10], [8, 18, 4, 9], [10, 16, 5, 8], [12, 14, 6, 7], [14, 12, 7, 6], [16, 10, 8, 5], [18, 8, 9, 4], [20, 6, 10, 3], [22, 4, 11, 2], [24, 2, 12, 1], [13, 13, 8, 8], [13, 13, 10, 10], [13, 13, 12, 12], [2, 24, 2, 24], [4, 22, 4, 22], [6, 20, 6, 20], [8, 18, 8, 18], [10, 16, 10, 16], [12, 14, 12, 14], [14, 12, 14, 12], [16, 10, 16, 10], [18, 8, 18, 8], [20, 6, 20, 6], [22, 4, 22, 4], [24, 2, 24, 2]])
(27, 14, [[9, 18, 2, 4], [18, 9, 4, 2], [9, 18, 4, 8], [18, 9, 8, 4], [3, 24, 2, 16], [6, 21, 4, 14], [9, 18, 6, 12], [12, 15, 8, 10], [15, 12, 10, 8], [18, 9, 12, 6], [21, 6, 14, 4], [24, 3, 16, 2], [9, 18, 8, 16], [18, 9, 16, 8]])
(28, 56, [[14, 14, 1, 1], [14, 14, 2, 2], [14, 14, 3, 3], [4, 24, 1, 6], [8, 20, 2, 5], [12, 16, 3, 4], [16, 12, 4, 3], [20, 8, 5, 2], [24, 4, 6, 1], [7, 21, 2, 6], [14, 14, 4, 4], [21, 7, 6, 2], [14, 14, 5, 5], [14, 14, 6, 6], [2, 26, 1, 13], [4, 24, 2, 12], [6, 22, 3, 11], [8, 20, 4, 10], [10, 18, 5, 9], [12, 16, 6, 8], [14, 14, 7, 7], [16, 12, 8, 6], [18, 10, 9, 5], [20, 8, 10, 4], [22, 6, 11, 3], [24, 4, 12, 2], [26, 2, 13, 1], [7, 21, 4, 12], [14, 14, 8, 8], [21, 7, 12, 4], [14, 14, 9, 9], [14, 14, 10, 10], [4, 24, 3, 18], [8, 20, 6, 15], [12, 16, 9, 12], [16, 12, 12, 9], [20, 8, 15, 6], [24, 4, 18, 3], [14, 14, 11, 11], [7, 21, 6, 18], [14, 14, 12, 12], [21, 7, 18, 6], [14, 14, 13, 13], [2, 26, 2, 26], [4, 24, 4, 24], [6, 22, 6, 22], [8, 20, 8, 20], [10, 18, 10, 18], [12, 16, 12, 16], [14, 14, 14, 14], [16, 12, 16, 12], [18, 10, 18, 10], [20, 8, 20, 8], [22, 6, 22, 6], [24, 4, 24, 4], [26, 2, 26, 2]])
(29, 0, [])
(30, 75, [[10, 20, 1, 2], [20, 10, 2, 1], [15, 15, 2, 2], [6, 24, 1, 4], [12, 18, 2, 3], [18, 12, 3, 2], [24, 6, 4, 1], [10, 20, 2, 4], [20, 10, 4, 2], [15, 15, 4, 4], [10, 20, 3, 6], [20, 10, 6, 3], [6, 24, 2, 8], [12, 18, 4, 6], [18, 12, 6, 4], [24, 6, 8, 2], [5, 25, 2, 10], [10, 20, 4, 8], [15, 15, 6, 6], [20, 10, 8, 4], [25, 5, 10, 2], [2, 28, 1, 14], [4, 26, 2, 13], [6, 24, 3, 12], [8, 22, 4, 11], [10, 20, 5, 10], [12, 18, 6, 9], [14, 16, 7, 8], [16, 14, 8, 7], [18, 12, 9, 6], [20, 10, 10, 5], [22, 8, 11, 4], [24, 6, 12, 3], [26, 4, 13, 2], [28, 2, 14, 1], [15, 15, 8, 8], [10, 20, 6, 12], [20, 10, 12, 6], [3, 27, 2, 18], [6, 24, 4, 16], [9, 21, 6, 14], [12, 18, 8, 12], [15, 15, 10, 10], [18, 12, 12, 8], [21, 9, 14, 6], [24, 6, 16, 4], [27, 3, 18, 2], [10, 20, 7, 14], [20, 10, 14, 7], [5, 25, 4, 20], [10, 20, 8, 16], [15, 15, 12, 12], [20, 10, 16, 8], [25, 5, 20, 4], [6, 24, 5, 20], [12, 18, 10, 15], [18, 12, 15, 10], [24, 6, 20, 5], [10, 20, 9, 18], [20, 10, 18, 9], [15, 15, 14, 14], [2, 28, 2, 28], [4, 26, 4, 26], [6, 24, 6, 24], [8, 22, 8, 22], [10, 20, 10, 20], [12, 18, 12, 18], [14, 16, 14, 16], [16, 14, 16, 14], [18, 12, 18, 12], [20, 10, 20, 10], [22, 8, 22, 8], [24, 6, 24, 6], [26, 4, 26, 4], [28, 2, 28, 2]]) |