The numbers of course approach 1/7 as m and n get larger.
m n numerator denominator reduced decimal value
num den
1 1 6 36 1 6 0.1666666666666666666
2 1 30 216 5 36 0.1388888888888888888
2 2 186 1296 31 216 0.1435185185185185184
3 1 186 1296 31 216 0.1435185185185185184
3 2 1110 7776 185 1296 0.1427469135802469135
3 3 6666 46656 1111 7776 0.142875514403292181
4 1 1110 7776 185 1296 0.1427469135802469135
4 2 6666 46656 1111 7776 0.142875514403292181
4 3 39990 279936 6665 46656 0.1428540809327846364
4 4 239946 1679616 39991 279936 0.1428576531778692272
5 1 6666 46656 1111 7776 0.142875514403292181
5 2 39990 279936 6665 46656 0.1428540809327846364
5 3 239946 1679616 39991 279936 0.1428576531778692272
5 4 1439670 10077696 239945 1679616 0.142857057803688462
5 5 8638026 60466176 1439671 10077696 0.1428571570327185896
6 1 39990 279936 6665 46656 0.1428540809327846364
6 2 239946 1679616 39991 279936 0.1428576531778692272
6 3 1439670 10077696 239945 1679616 0.142857057803688462
6 4 8638026 60466176 1439671 10077696 0.1428571570327185896
6 5 51828150 362797056 8638025 60466176 0.1428571404945469017
6 6 310968906 2176782336 51828151 362797056 0.1428571432509088497
7 1 239946 1679616 39991 279936 0.1428576531778692272
7 2 1439670 10077696 239945 1679616 0.142857057803688462
7 3 8638026 60466176 1439671 10077696 0.1428571570327185896
7 4 51828150 362797056 8638025 60466176 0.1428571404945469017
7 5 310968906 2176782336 51828151 362797056 0.1428571432509088497
7 6 1865813430 13060694016 310968905 2176782336 0.1428571427915151916
7 7 11194880586 78364164096 1865813431 13060694016 0.1428571428680808013
4 kill "2sumsmd7.txt":open "2sumsmd7.txt" for output as #2
5 dim Mtot(7),Ntot(7)
10 for M=1 to 7
20 Mtot=0
30 erase Mtot():dim Mtot(7):MOverTot=0:mIndTot=0
60 gosub *addonM(1)
80 for N=1 to M
90 erase Ntot():dim Ntot(7):NOverTot=0:nIndTot=0
120 gosub *addonN(1)
140 POverTot=0
150 for I=1 to 7
160 POverTot=POverTot+Mtot(I)*Ntot(I)
170 next
180 Dn=MOverTot*NOverTot
190 G=gcd(POverTot,Dn)
200 print M;N,POverTot;Dn,POverTot//G;Dn//G,POverTot/Dn
210 print #2,M;N;" ";POverTot;Dn;" ";POverTot//G;Dn//G;" ";POverTot/Dn
240 next N
250 next M
260 close #2
300 end
310
320 *addonM(wh)
330 local v
340 for v=1 to 6
350 mIndTot=mIndTot+v
360 if wh=m then
370 :mval=(mIndTot-1)@7+1
380 :inc mtot(mval):inc mOverTot
390 :else
400 :gosub *addonM(wh+1)
410 :endif
420 mIndTot=mIndTot-v
430 next v
440 return
450
460
470
480 *addonN(wh)
490 local v
500 for v=1 to 6
510 nIndTot=nIndTot+v
520 if wh=n then
530 :nval=(nIndTot-1)@7+1
540 :inc ntot(nval):inc nOverTot
550 :else
560 :gosub *addonN(wh+1)
570 :endif
580 nIndTot=nIndTot-v
590 next v
600 return
|
Posted by Charlie
on 2016-10-05 14:43:35 |