离死亡还有 往生已逝的放废话的空间 20101208

往生已逝的放废话的空间

往生已逝のゴミ言葉箱【心跳回忆百科全书建设中】

扭曲的数学 续

上次说到

四 排除三个数中有两数绝对值相同的情况 穷举所有结果
提出这个问题,是因为我想看看1-100的数字的非平凡解是哪个数字最多

友人core继续改良了算法,解说如下

Dear Chenqu, 
本次程序優化內容如下: 
x,y,z的嘗試規則原本為 
x = [-100, 100] 
y = [-100, 100] 
z = [-100, 100] 
實際上這樣浪費了很多時間出相同的結果 (-5, -6, 7和-5, 7, -6會各出現一次但實際上我們要一次就可以了) 
所以現在改成 
x = [-100, 100] 
y = [-100, -|x|] U [|x|, 100] 
z = [-100, -|y|] U [|y|, 100] 
大幅度下降嘗試度. 
這是你要的數據: 
下一個優化的嘗試是: 立方(或者說冪)不改變奇偶性, 可以藉此砍掉一半運算. 
Regards,

No result found for 0 when x, y, z E [-100, 100].
1 = cube(-6) + cube(-8) + cube(9)
1 = cube(9) + cube(10) + cube(-12)
Totally 2 results for number 1.
2 = cube(-5) + cube(-6) + cube(7)
2 = cube(-24) + cube(-47) + cube(49)
Totally 2 results for number 2.
No result found for 3 when x, y, z E [-100, 100].
No result found for 4 when x, y, z E [-100, 100].
No result found for 5 when x, y, z E [-100, 100].
6 = cube(-43) + cube(-58) + cube(65)
Totally 1 results for number 6.
7 = cube(0) + cube(-1) + cube(2)
Totally 1 results for number 7.
8 = cube(9) + cube(15) + cube(-16)
8 = cube(-12) + cube(-16) + cube(18)
8 = cube(15) + cube(33) + cube(-34)
8 = cube(-17) + cube(-40) + cube(41)
8 = cube(18) + cube(20) + cube(-24)
8 = cube(41) + cube(86) + cube(-89)
Totally 6 results for number 8.
9 = cube(0) + cube(1) + cube(2)
Totally 1 results for number 9.
No result found for 10 when x, y, z E [-100, 100].
No result found for 11 when x, y, z E [-100, 100].
12 = cube(7) + cube(10) + cube(-11)
Totally 1 results for number 12.
No result found for 13 when x, y, z E [-100, 100].
No result found for 14 when x, y, z E [-100, 100].
15 = cube(23) + cube(44) + cube(-46)
Totally 1 results for number 15.
16 = cube(-10) + cube(-12) + cube(14)
16 = cube(-48) + cube(-94) + cube(98)
Totally 2 results for number 16.
17 = cube(25) + cube(50) + cube(-52)
Totally 1 results for number 17.
18 = cube(-1) + cube(-2) + cube(3)
Totally 1 results for number 18.
19 = cube(0) + cube(-2) + cube(3)
19 = cube(-14) + cube(-16) + cube(19)
19 = cube(26) + cube(76) + cube(-77)
19 = cube(47) + cube(91) + cube(-95)
Totally 4 results for number 19.
20 = cube(1) + cube(-2) + cube(3)
20 = cube(21) + cube(55) + cube(-56)
Totally 2 results for number 20.
21 = cube(-11) + cube(-14) + cube(16)
21 = cube(28) + cube(85) + cube(-86)
Totally 2 results for number 21.
No result found for 22 when x, y, z E [-100, 100].
No result found for 23 when x, y, z E [-100, 100].
No result found for 24 when x, y, z E [-100, 100].
No result found for 25 when x, y, z E [-100, 100].
26 = cube(0) + cube(-1) + cube(3)
Totally 1 results for number 26.
27 = cube(-4) + cube(-5) + cube(6)
27 = cube(-10) + cube(-18) + cube(19)
27 = cube(-18) + cube(-24) + cube(27)
27 = cube(22) + cube(59) + cube(-60)
27 = cube(27) + cube(30) + cube(-36)
27 = cube(-36) + cube(-37) + cube(46)
Totally 6 results for number 27.
28 = cube(0) + cube(1) + cube(3)
28 = cube(13) + cube(14) + cube(-17)
28 = cube(31) + cube(56) + cube(-59)
Totally 3 results for number 28.
29 = cube(-2) + cube(-3) + cube(4)
29 = cube(13) + cube(18) + cube(-20)
Totally 2 results for number 29.
No result found for 30 when x, y, z E [-100, 100].
No result found for 31 when x, y, z E [-100, 100].
No result found for 32 when x, y, z E [-100, 100].
No result found for 33 when x, y, z E [-100, 100].
34 = cube(-1) + cube(2) + cube(3)
34 = cube(-3) + cube(-4) + cube(5)
Totally 2 results for number 34.
35 = cube(0) + cube(2) + cube(3)
35 = cube(-8) + cube(-13) + cube(14)
Totally 2 results for number 35.
36 = cube(1) + cube(2) + cube(3)
36 = cube(-1) + cube(-3) + cube(4)
36 = cube(40) + cube(71) + cube(-75)
Totally 3 results for number 36.
37 = cube(0) + cube(-3) + cube(4)
37 = cube(37) + cube(50) + cube(-56)
Totally 2 results for number 37.
38 = cube(1) + cube(-3) + cube(4)
38 = cube(16) + cube(25) + cube(-27)
Totally 2 results for number 38.
No result found for 39 when x, y, z E [-100, 100].
No result found for 40 when x, y, z E [-100, 100].
No result found for 41 when x, y, z E [-100, 100].
No result found for 42 when x, y, z E [-100, 100].
43 = cube(8) + cube(12) + cube(-13)
43 = cube(20) + cube(51) + cube(-52)
Totally 2 results for number 43.
44 = cube(-5) + cube(-7) + cube(8)
Totally 1 results for number 44.
45 = cube(2) + cube(-3) + cube(4)
Totally 1 results for number 45.
46 = cube(19) + cube(26) + cube(-29)
Totally 1 results for number 46.
47 = cube(6) + cube(7) + cube(-8)
47 = cube(-14) + cube(-30) + cube(31)
Totally 2 results for number 47.
48 = cube(-23) + cube(-26) + cube(31)
Totally 1 results for number 48.
No result found for 49 when x, y, z E [-100, 100].
No result found for 50 when x, y, z E [-100, 100].
No result found for 51 when x, y, z E [-100, 100].
No result found for 52 when x, y, z E [-100, 100].
53 = cube(-2) + cube(-4) + cube(5)
Totally 1 results for number 53.
54 = cube(-7) + cube(-11) + cube(12)
54 = cube(-15) + cube(-18) + cube(21)
Totally 2 results for number 54.
55 = cube(-1) + cube(-2) + cube(4)
55 = cube(-6) + cube(-9) + cube(10)
Totally 2 results for number 55.
56 = cube(0) + cube(-2) + cube(4)
56 = cube(-11) + cube(-21) + cube(22)
56 = cube(31) + cube(42) + cube(-47)
Totally 3 results for number 56.
57 = cube(1) + cube(-2) + cube(4)
57 = cube(25) + cube(34) + cube(-38)
Totally 2 results for number 57.
No result found for 58 when x, y, z E [-100, 100].
No result found for 59 when x, y, z E [-100, 100].
60 = cube(-1) + cube(-4) + cube(5)
Totally 1 results for number 60.
61 = cube(0) + cube(-4) + cube(5)
Totally 1 results for number 61.
62 = cube(1) + cube(-4) + cube(5)
62 = cube(22) + cube(41) + cube(-43)
Totally 2 results for number 62.
63 = cube(0) + cube(-1) + cube(4)
63 = cube(-4) + cube(-6) + cube(7)
63 = cube(-37) + cube(-63) + cube(67)
63 = cube(-38) + cube(-58) + cube(63)
Totally 4 results for number 63.
64 = cube(-3) + cube(-5) + cube(6)
64 = cube(-17) + cube(-22) + cube(25)
64 = cube(18) + cube(30) + cube(-32)
64 = cube(-24) + cube(-32) + cube(36)
64 = cube(30) + cube(66) + cube(-68)
64 = cube(-34) + cube(-80) + cube(82)
64 = cube(36) + cube(40) + cube(-48)
Totally 7 results for number 64.
65 = cube(0) + cube(1) + cube(4)
Totally 1 results for number 65.
No result found for 66 when x, y, z E [-100, 100].
No result found for 67 when x, y, z E [-100, 100].
No result found for 68 when x, y, z E [-100, 100].
69 = cube(2) + cube(-4) + cube(5)
69 = cube(-19) + cube(-22) + cube(26)
Totally 2 results for number 69.
70 = cube(11) + cube(20) + cube(-21)
70 = cube(23) + cube(63) + cube(-64)
Totally 2 results for number 70.
71 = cube(-1) + cube(2) + cube(4)
71 = cube(12) + cube(23) + cube(-24)
71 = cube(-16) + cube(-20) + cube(23)
71 = cube(-22) + cube(-33) + cube(36)
Totally 4 results for number 71.
72 = cube(0) + cube(2) + cube(4)
72 = cube(7) + cube(9) + cube(-10)
72 = cube(-13) + cube(-27) + cube(28)
Totally 3 results for number 72.
73 = cube(1) + cube(2) + cube(4)
73 = cube(-12) + cube(-24) + cube(25)
73 = cube(29) + cube(43) + cube(-47)
Totally 3 results for number 73.
No result found for 74 when x, y, z E [-100, 100].
No result found for 75 when x, y, z E [-100, 100].
No result found for 76 when x, y, z E [-100, 100].
No result found for 77 when x, y, z E [-100, 100].
78 = cube(26) + cube(53) + cube(-55)
Totally 1 results for number 78.
79 = cube(-19) + cube(-33) + cube(35)
79 = cube(-49) + cube(-66) + cube(74)
Totally 2 results for number 79.
No result found for 80 when x, y, z E [-100, 100].
81 = cube(10) + cube(17) + cube(-18)
Totally 1 results for number 81.
No result found for 82 when x, y, z E [-100, 100].
83 = cube(-2) + cube(3) + cube(4)
83 = cube(-2) + cube(-5) + cube(6)
83 = cube(-15) + cube(-23) + cube(25)
83 = cube(22) + cube(24) + cube(-29)
83 = cube(-32) + cube(-36) + cube(43)
Totally 5 results for number 83.
No result found for 84 when x, y, z E [-100, 100].
No result found for 85 when x, y, z E [-100, 100].
No result found for 86 when x, y, z E [-100, 100].
No result found for 87 when x, y, z E [-100, 100].
88 = cube(3) + cube(-4) + cube(5)
88 = cube(-9) + cube(-16) + cube(17)
Totally 2 results for number 88.
No result found for 89 when x, y, z E [-100, 100].
90 = cube(-1) + cube(3) + cube(4)
90 = cube(-1) + cube(-5) + cube(6)
90 = cube(-2) + cube(-3) + cube(5)
90 = cube(-8) + cube(-9) + cube(11)
90 = cube(13) + cube(26) + cube(-27)
90 = cube(19) + cube(47) + cube(-48)
90 = cube(31) + cube(99) + cube(-100)
90 = cube(-32) + cube(-73) + cube(75)
90 = cube(-35) + cube(-51) + cube(56)
Totally 9 results for number 90.
91 = cube(0) + cube(3) + cube(4)
91 = cube(0) + cube(-5) + cube(6)
Totally 2 results for number 91.
92 = cube(1) + cube(3) + cube(4)
92 = cube(1) + cube(-5) + cube(6)
92 = cube(-5) + cube(-8) + cube(9)
Totally 3 results for number 92.
No result found for 93 when x, y, z E [-100, 100].
No result found for 94 when x, y, z E [-100, 100].
No result found for 95 when x, y, z E [-100, 100].
96 = cube(14) + cube(20) + cube(-22)
Totally 1 results for number 96.
97 = cube(-1) + cube(-3) + cube(5)
97 = cube(17) + cube(18) + cube(-22)
Totally 2 results for number 97.
98 = cube(0) + cube(-3) + cube(5)
98 = cube(9) + cube(14) + cube(-15)
Totally 2 results for number 98.
99 = cube(1) + cube(-3) + cube(5)
99 = cube(2) + cube(3) + cube(4)
99 = cube(2) + cube(-5) + cube(6)
99 = cube(16) + cube(36) + cube(-37)
Totally 4 results for number 99.
100 = cube(-3) + cube(-6) + cube(7)
Totally 1 results for number 100.
Total 58 valid numbers in [0, 100].
Completed in 7 s.

Core查阅资料有结论:除9余4或5的数字一定不可以表示成三个整数立方之和
因此事实上这样又可以排除掉2/9的数据量

这样很明显,90是被宠爱着的数字吧。在这短短的1~100内有九种表示方式。实在是有趣。
又另外,参照99可以发现一个很容易被遗忘的美妙的结论:1^3+2^3+3^3+4^3=100






---【扭曲系】 | 留言:0 | 引用:0 |
| 主页 |