For a positive integer n > 2, consider the n-1 fractions
2/1; 3/2; ...; n/(n-1).
The product of these fractions equals n, but if you reciprocate (i.e. turn upside down) some of the fractions, the
product will change.
How can you make the product equal 1?
Find all values of n for which this is possible.
The sequence 1 1 0 0 0 0 0 0 1 below is interpreted as
2/1 and 3/2 are left alone, while the rest are inverted (reciprocated). the product is 1.
2/1 * 3/2 = 3
3/4 * 4/5 * ... * 8/9 = 1/3
The product is 1.
Note that other occurrences of 1 are also found below, with the sequence code being interpreted the same way as to which fractions are inverted.
All the possible products:
1//9
9//64
64//441
9//49
49//324
49//256
16//81
1//4
4//25
81//400
256//1225
324//1225
49//225
441//1600
64//225
9//25
25//144
225//1024
100//441
225//784
1225//5184
1225//4096
25//81
25//64
1//4
81//256
16//49
81//196
49//144
441//1024
4//9
9//16
16//81
1//4
1024//3969
16//49
196//729
49//144
256//729
4//9
64//225
9//25
4096//11025
576//1225
784//2025
49//100
1024//2025
16//25
25//81
25//64
1600//3969
25//49
1225//2916
1225//2304
400//729
25//36
4//9
9//16
256//441
36//49
49//81
49//64
64//81
1
0 0 1 1 1 1 1 1 1
1//4
81//256
16//49
81//196
49//144
441//1024
4//9
9//16
9//25
729//1600
576//1225
729//1225
49//100
3969//6400
16//25
81//100
25//64
2025//4096
25//49
2025//3136
1225//2304
11025//16384
25//36
225//256
9//16
729//1024
36//49
729//784
49//64
3969//4096
1
0 1 0 1 1 1 1 0 1
81//64
4//9
9//16
256//441
36//49
49//81
49//64
64//81
1
0 1 1 0 0 1 1 1 1
16//25
81//100
1024//1225
1296//1225
196//225
441//400
256//225
36//25
25//36
225//256
400//441
225//196
1225//1296
1225//1024
100//81
25//16
1
0 1 1 1 1 0 0 0 1
81//64
64//49
81//49
49//36
441//256
16//9
9//4
4//9
9//16
256//441
36//49
49//81
49//64
64//81
1
1 0 0 0 0 1 1 1 1
16//25
81//100
1024//1225
1296//1225
196//225
441//400
256//225
36//25
25//36
225//256
400//441
225//196
1225//1296
1225//1024
100//81
25//16
1
1 0 0 1 1 0 0 0 1
81//64
64//49
81//49
49//36
441//256
16//9
9//4
64//81
1
1 0 1 0 0 0 0 1 1
4096//3969
64//49
784//729
49//36
1024//729
16//9
256//225
36//25
16384//11025
2304//1225
3136//2025
49//25
4096//2025
64//25
100//81
25//16
6400//3969
100//49
1225//729
1225//576
1600//729
25//9
16//9
9//4
1024//441
144//49
196//81
49//16
256//81
4
1 0 1 1 1 1 1 1 4
1
1 1 0 0 0 0 0 0 1
81//64
64//49
81//49
49//36
441//256
16//9
9//4
36//25
729//400
2304//1225
2916//1225
49//25
3969//1600
64//25
81//25
25//16
2025//1024
100//49
2025//784
1225//576
11025//4096
25//9
225//64
9//4
729//256
144//49
729//196
49//16
3969//1024
4
1 1 0 1 1 1 1 0 4
81//16
16//9
9//4
1024//441
144//49
196//81
49//16
256//81
4
1 1 1 0 0 1 1 1 4
64//25
81//25
4096//1225
5184//1225
784//225
441//100
1024//225
144//25
25//9
225//64
1600//441
225//49
1225//324
1225//256
400//81
25//4
4
1 1 1 1 1 0 0 0 4
81//16
256//49
324//49
49//9
441//64
64//9
9
1 1 1 1 1 1 1 1 9
5 kill "riteprod.txt"
10 dim Fr(9),h(9)
20 for I=1 to 8
30 Fr(I)=(I+1)//I
40 next
45 open "riteprod.txt" for output as #2
46 tot=1
50 gosub *addOn(1)
55 close #2
60 end
70 *addOn(wh)
75 local newfr,newfrNo
80 for newfrNo=0 to 1
85 h(wh)=newfrNo
90 if newfrNo=1 then newfr=fr(wh):else newfr=1//fr(wh):endif
100 tot=tot*newfr
110 if wh=8 then
120 :print #2,tot
122 :if tot=int(tot) then
123 :for i=1 to 8
124 : print h(i);:print #2,h(i);
125 :next
126 :print tot:print #2,tot
127 :endif
130 :else
140 :gosub *addOn(wh+1)
150 :endif
160 tot=tot//newfr
170 next
180 return
Edited on December 2, 2015, 11:18 am
|
Posted by Charlie
on 2015-12-02 11:11:35 |