数学中国

 找回密码
 注册
搜索
热搜: 活动 交友 discuz
查看: 3475|回复: 55

三角数不定方程的通解公式的验证

[复制链接]
发表于 2023-3-3 14:21 | 显示全部楼层 |阅读模式
本帖最后由 ysr 于 2023-3-3 07:25 编辑

三角^2
数方程为:
x(x+1)+y(y+1)=z(z+1)

待验证的公式:
x=r
y=s
z=r+s+t
r=m^2-n^2
s=m^2+n^2
t<=1-r
c=2(rs+rt+st)+t^2

其中t<0,t的绝对值小于r

当z和c均大于0时就是方程的解,程序结果如下:
输入:100,就是n小于等于100
结果:
x = 3 y=5 c=2 z=6 t= -2
x = 5 y=13 c=2 z=14 t= -4
x = 7 y=25 c=2 z=26 t= -6
x = 9 y=41 c=2 z=42 t= -8
x = 11 y=61 c=2 z=62 t= -10
x = 13 y=85 c=2 z=86 t= -12
x = 15 y=113 c=2 z=114 t= -14
x = 17 y=145 c=2 z=146 t= -16
x = 19 y=181 c=2 z=182 t= -18
x = 21 y=221 c=2 z=222 t= -20
x = 23 y=265 c=2 z=266 t= -22
x = 25 y=313 c=2 z=314 t= -24
x = 27 y=365 c=2 z=366 t= -26
x = 29 y=421 c=2 z=422 t= -28
x = 31 y=481 c=2 z=482 t= -30
x = 33 y=545 c=2 z=546 t= -32
x = 35 y=613 c=2 z=614 t= -34
x = 37 y=685 c=2 z=686 t= -36
x = 39 y=761 c=2 z=762 t= -38
x = 41 y=841 c=2 z=842 t= -40
x = 43 y=925 c=2 z=926 t= -42
x = 45 y=1013 c=2 z=1014 t= -44
x = 47 y=1105 c=2 z=1106 t= -46
x = 49 y=1201 c=2 z=1202 t= -48
x = 51 y=1301 c=2 z=1302 t= -50
x = 53 y=1405 c=2 z=1406 t= -52
x = 55 y=1513 c=2 z=1514 t= -54
x = 57 y=1625 c=2 z=1626 t= -56
x = 59 y=1741 c=2 z=1742 t= -58
x = 61 y=1861 c=2 z=1862 t= -60
x = 63 y=1985 c=2 z=1986 t= -62
x = 65 y=2113 c=2 z=2114 t= -64
x = 67 y=2245 c=2 z=2246 t= -66
x = 69 y=2381 c=2 z=2382 t= -68
x = 71 y=2521 c=2 z=2522 t= -70
x = 73 y=2665 c=2 z=2666 t= -72
x = 75 y=2813 c=2 z=2814 t= -74
x = 77 y=2965 c=2 z=2966 t= -76
x = 79 y=3121 c=2 z=3122 t= -78
x = 81 y=3281 c=2 z=3282 t= -80
x = 83 y=3445 c=2 z=3446 t= -82
x = 85 y=3613 c=2 z=3614 t= -84
x = 87 y=3785 c=2 z=3786 t= -86
x = 89 y=3961 c=2 z=3962 t= -88
x = 91 y=4141 c=2 z=4142 t= -90
x = 93 y=4325 c=2 z=4326 t= -92
x = 95 y=4513 c=2 z=4514 t= -94
x = 97 y=4705 c=2 z=4706 t= -96
x = 99 y=4901 c=2 z=4902 t= -98
x = 101 y=5101 c=2 z=5102 t= -100
x = 103 y=5305 c=2 z=5306 t= -102
x = 105 y=5513 c=2 z=5514 t= -104
x = 107 y=5725 c=2 z=5726 t= -106
x = 109 y=5941 c=2 z=5942 t= -108
x = 111 y=6161 c=2 z=6162 t= -110
x = 113 y=6385 c=2 z=6386 t= -112
x = 115 y=6613 c=2 z=6614 t= -114
x = 117 y=6845 c=2 z=6846 t= -116
x = 119 y=7081 c=2 z=7082 t= -118
x = 121 y=7321 c=2 z=7322 t= -120
x = 123 y=7565 c=2 z=7566 t= -122
x = 125 y=7813 c=2 z=7814 t= -124
x = 127 y=8065 c=2 z=8066 t= -126
x = 129 y=8321 c=2 z=8322 t= -128
x = 131 y=8581 c=2 z=8582 t= -130
x = 133 y=8845 c=2 z=8846 t= -132
x = 135 y=9113 c=2 z=9114 t= -134
x = 137 y=9385 c=2 z=9386 t= -136
x = 139 y=9661 c=2 z=9662 t= -138
x = 141 y=9941 c=2 z=9942 t= -140
x = 143 y=10225 c=2 z=10226 t= -142
x = 145 y=10513 c=2 z=10514 t= -144
x = 147 y=10805 c=2 z=10806 t= -146
x = 149 y=11101 c=2 z=11102 t= -148
x = 151 y=11401 c=2 z=11402 t= -150
x = 153 y=11705 c=2 z=11706 t= -152
x = 155 y=12013 c=2 z=12014 t= -154
x = 157 y=12325 c=2 z=12326 t= -156
x = 159 y=12641 c=2 z=12642 t= -158
x = 161 y=12961 c=2 z=12962 t= -160
x = 163 y=13285 c=2 z=13286 t= -162
x = 165 y=13613 c=2 z=13614 t= -164
x = 167 y=13945 c=2 z=13946 t= -166
x = 169 y=14281 c=2 z=14282 t= -168
x = 171 y=14621 c=2 z=14622 t= -170
x = 173 y=14965 c=2 z=14966 t= -172
x = 175 y=15313 c=2 z=15314 t= -174
x = 177 y=15665 c=2 z=15666 t= -176
x = 179 y=16021 c=2 z=16022 t= -178
x = 181 y=16381 c=2 z=16382 t= -180
x = 183 y=16745 c=2 z=16746 t= -182
x = 185 y=17113 c=2 z=17114 t= -184
x = 187 y=17485 c=2 z=17486 t= -186
x = 189 y=17861 c=2 z=17862 t= -188
x = 191 y=18241 c=2 z=18242 t= -190
x = 193 y=18625 c=2 z=18626 t= -192
x = 195 y=19013 c=2 z=19014 t= -194
x = 197 y=19405 c=2 z=19406 t= -196
x = 199 y=19801 c=2 z=19802 t= -198

代码如下:

Private Sub Command1_Click()
Dim m, n, x, y, z
a = Val(Text1)
n = 1
Do While n <= a
m = Val(n + 1)
Do While m <= a
r = Val(m ^ 2 - n ^ 2)
t = Val(1 - r)
Do While Abs(t) < r
s = Val(m ^ 2 + n ^ 2)
x = r
y = s
c = Val(2 * (r * s + r * t + s * t) + t ^ 2)
z = Val(r + s + t)
If Val(c) > 0 And Val(z) > 0 Then
s2 = Val(s2 + 1)
s1 = s1 & "x = " & x & " y=" & y & " c=" & c & " z=" & z & " t= " & t & vbCrLf
Else
s2 = s2
End If


t = Val(t - 1)
Loop


m = Val(m + 1)
Loop
n = Val(n + 1)
Loop

If s2 > 0 Then
Text2 = s1
Else
Text2 = "wu   jie"
End If


End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
End Sub
发表于 2023-3-3 14:36 | 显示全部楼层
\[(x,y,z)=(2n+1,2n^2+3n,2n^2+3n+1)\]

点评

ysr
这仅是部分解吧?x还有偶数的时候呢,我试试您的公式吧,在家里呢,我的电脑慢  发表于 2023-3-3 15:23
ysr
好的,我试试,除了一楼的第一组,别的都不是原方程的解  发表于 2023-3-3 15:03
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-3-3 15:00 | 显示全部楼层
除了一楼的第一组解以外其他都不是原方程的解,公式待解,问题没有解决。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-3-3 15:31 | 显示全部楼层
如下为利用T先生的公式,得到的100组解:
x=3  y=5  z=6
x=5  y=14  z=15
x=7  y=27  z=28
x=9  y=44  z=45
x=11  y=65  z=66
x=13  y=90  z=91
x=15  y=119  z=120
x=17  y=152  z=153
x=19  y=189  z=190
x=21  y=230  z=231
x=23  y=275  z=276
x=25  y=324  z=325
x=27  y=377  z=378
x=29  y=434  z=435
x=31  y=495  z=496
x=33  y=560  z=561
x=35  y=629  z=630
x=37  y=702  z=703
x=39  y=779  z=780
x=41  y=860  z=861
x=43  y=945  z=946
x=45  y=1034  z=1035
x=47  y=1127  z=1128
x=49  y=1224  z=1225
x=51  y=1325  z=1326
x=53  y=1430  z=1431
x=55  y=1539  z=1540
x=57  y=1652  z=1653
x=59  y=1769  z=1770
x=61  y=1890  z=1891
x=63  y=2015  z=2016
x=65  y=2144  z=2145
x=67  y=2277  z=2278
x=69  y=2414  z=2415
x=71  y=2555  z=2556
x=73  y=2700  z=2701
x=75  y=2849  z=2850
x=77  y=3002  z=3003
x=79  y=3159  z=3160
x=81  y=3320  z=3321
x=83  y=3485  z=3486
x=85  y=3654  z=3655
x=87  y=3827  z=3828
x=89  y=4004  z=4005
x=91  y=4185  z=4186
x=93  y=4370  z=4371
x=95  y=4559  z=4560
x=97  y=4752  z=4753
x=99  y=4949  z=4950
x=101  y=5150  z=5151
x=103  y=5355  z=5356
x=105  y=5564  z=5565
x=107  y=5777  z=5778
x=109  y=5994  z=5995
x=111  y=6215  z=6216
x=113  y=6440  z=6441
x=115  y=6669  z=6670
x=117  y=6902  z=6903
x=119  y=7139  z=7140
x=121  y=7380  z=7381
x=123  y=7625  z=7626
x=125  y=7874  z=7875
x=127  y=8127  z=8128
x=129  y=8384  z=8385
x=131  y=8645  z=8646
x=133  y=8910  z=8911
x=135  y=9179  z=9180
x=137  y=9452  z=9453
x=139  y=9729  z=9730
x=141  y=10010  z=10011
x=143  y=10295  z=10296
x=145  y=10584  z=10585
x=147  y=10877  z=10878
x=149  y=11174  z=11175
x=151  y=11475  z=11476
x=153  y=11780  z=11781
x=155  y=12089  z=12090
x=157  y=12402  z=12403
x=159  y=12719  z=12720
x=161  y=13040  z=13041
x=163  y=13365  z=13366
x=165  y=13694  z=13695
x=167  y=14027  z=14028
x=169  y=14364  z=14365
x=171  y=14705  z=14706
x=173  y=15050  z=15051
x=175  y=15399  z=15400
x=177  y=15752  z=15753
x=179  y=16109  z=16110
x=181  y=16470  z=16471
x=183  y=16835  z=16836
x=185  y=17204  z=17205
x=187  y=17577  z=17578
x=189  y=17954  z=17955
x=191  y=18335  z=18336
x=193  y=18720  z=18721
x=195  y=19109  z=19110
x=197  y=19502  z=19503
x=199  y=19899  z=19900
x=201  y=20300  z=20301
回复 支持 反对

使用道具 举报

发表于 2023-3-3 15:50 | 显示全部楼层
Treenewbee 发表于 2023-3-3 14:36
\[(x,y,z)=(2n+1,2n^2+3n,2n^2+3n+1)\]

这是你的一楼的数据的通解

点评

ysr
好,谢谢!我再试试偶数的情况!  发表于 2023-3-3 15:58
回复 支持 反对

使用道具 举报

发表于 2023-3-3 16:04 | 显示全部楼层
\[x(x+1)+y(y+1)=z(z+1)\]的通解就是
\[c=2z^2+2z+1\] 是合数

点评

ysr
好,谢谢!我得到了x为偶数的一组解,是否已经是全部解了,加上您的x为奇数的情况?  发表于 2023-3-3 16:11
回复 支持 反对

使用道具 举报

发表于 2023-3-3 16:08 | 显示全部楼层
比如,\[z=[\frac{5n}{2}]+1\] 一定是可以找到解的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-3-3 16:09 | 显示全部楼层
本帖最后由 ysr 于 2023-3-4 21:29 编辑

偶数的情况,得到10组解:
x=4  y=9  z=10
x=6  y=20  z=21
x=8  y=35  z=36
x=10  y=54  z=55
x=12  y=77  z=78
x=14  y=104  z=105
x=16  y=135  z=136
x=18  y=170  z=171
x=20  y=209  z=210
x=22  y=252  z=253
公式是:
x = 2 * n + 2
y = 2 * (n + 1) ^ 2 + n
z = 2 * (n + 1) ^ 2 + n + 1
代码如下:
Private Sub Command1_Click()
'代码为x是偶数的解,存一下吧
Dim p, q, x, y, z
A = Val(Text1)
n = 1
Do While Val(n) <= A

x = 2 * n + 2
y = 2 * (n + 1) ^ 2 + n
z = 2 * (n + 1) ^ 2 + n + 1


If y > 0 And z > 0 Then
s2 = s2 + 1
s1 = s1 & "x=" & x & "  y=" & y & "  z=" & z & vbCrLf
Else
s2 = s2
End If

n = n + 1
Loop


If Val(s2) > 0 Then
Text2 = s1
Else
Text2 = "wu   jie"
End If


End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
End Sub

Private Sub Command1_Click()
'代码为x是奇数的解,存一下吧
Dim p, q, x, y, z
A = Val(Text1)
n = 1
Do While Val(n) <= A

x = 2 * n + 1
y = 2 * n ^ 2 + 3 * n
z = 2 * n ^ 2 + 3 * n + 1


If y > 0 And z > 0 Then
s2 = s2 + 1
s1 = s1 & "x=" & x & "  y=" & y & "  z=" & z & vbCrLf
Else
s2 = s2
End If

n = n + 1
Loop


If Val(s2) > 0 Then
Text2 = s1
Else
Text2 = "wu   jie"
End If


End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
End Sub
回复 支持 反对

使用道具 举报

发表于 2023-3-3 16:26 | 显示全部楼层
或者 \[z=6 n + 9 + [\frac{2 n + 1 + 3*(-1)^n}{4}]\]

或者 \[z=8n -5 + [\frac{2 n + 1 -9*(-1)^n}{4}]\]

点评

ysr
好的,此时x和y分别是几?  发表于 2023-3-3 16:31
回复 支持 反对

使用道具 举报

发表于 2023-3-3 16:30 | 显示全部楼层
参考 A012132                Numbers z such that x*(x+1) + y*(y+1) = z*(z+1) is solvable in positive integers x,y.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|数学中国 ( 京ICP备05040119号 )

GMT+8, 2024-5-4 09:55 , Processed in 0.086914 second(s), 17 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表