回复 8# 282842712474 的帖子
你的方法也很好啊,在你的基础上,把那个$sqrt(2)$的连分式用递推公式表达,似乎就可以得到a(0) = 0, a(1) = 3.
a(n)=6a(n-1)-a(n-2)+2
太棒了,谢谢你的提醒!!!
回复 4# litaoye 的帖子
“破方程”是啥意思,litaoye ,你能给我详细解释一下吗,或者给一个链接,我搜不到有用信息,谢谢了 "破方程"="pell方程"回复 13# medie2005 的帖子
haha,让你见笑了 发现直接解方程也可以很快得到前面的一些结果:In:= MAX = 10^20;
Reduce[x^2 + (x + 1)^2 == z^2 && 1 <= x <= MAX && z > 1, {x,
z}, Integers]
Out= (x == 3 && z == 5) || (x == 20 && z == 29) || (x == 119 &&
z == 169) || (x == 696 && z == 985) || (x == 4059 &&
z == 5741) || (x == 23660 && z == 33461) || (x == 137903 &&
z == 195025) || (x == 803760 && z == 1136689) || (x == 4684659 &&
z == 6625109) || (x == 27304196 &&
z == 38613965) || (x == 159140519 &&
z == 225058681) || (x == 927538920 &&
z == 1311738121) || (x == 5406093003 &&
z == 7645370045) || (x == 31509019100 &&
z == 44560482149) || (x == 183648021599 &&
z == 259717522849) || (x == 1070379110496 &&
z == 1513744654945) || (x == 6238626641379 &&
z == 8822750406821) || (x == 36361380737780 &&
z == 51422757785981) || (x == 211929657785303 &&
z == 299713796309065) || (x == 1235216565974040 &&
z == 1746860020068409) || (x == 7199369738058939 &&
z == 10181446324101389) || (x == 41961001862379596 &&
z == 59341817924539925) || (x == 244566641436218639 &&
z == 345869461223138161) || (x == 1425438846754932240 &&
z == 2015874949414289041) || (x == 8308066439093374803 &&
z == 11749380235262596085) || (x == 48422959787805316580 &&
z == 68480406462161287469)
回复 15# kofeffect 的帖子
根据282842712474 的思路,所求的k值就是$sqrt(2)$的不足近似分数的分子减去1,再除以2。于是得此算法,速度自然是超级的快:In:= a = {1}; Table] - 1), {i, 20}]
Out= {3, 20, 119, 696, 4059, 23660, 137903, 803760, 4684659, \
27304196, 159140519, 927538920, 5406093003, 31509019100, \
183648021599, 1070379110496, 6238626641379, 36361380737780, \
211929657785303, 1235216565974040}
回复 16# wayne 的帖子
其实mathematica很强大,可以仅仅根据序列的前几个值就可以自动找出该序列的通项公式,In:= Floor[(Sqrt + 1)^(2 n + 1)/4] /. n -> RangeOut= {3, 20, 119, 696, 4059, 23660, 137903, 803760, 4684659, \
27304196, 159140519, 927538920, 5406093003} 其实只要wayne看过潘承洞的简明数论,这个问题很简单的,在那本书的最后一章,他的书写得很好!推荐去看一看,如果你对数论有那么一点点兴趣的话! 也就是说连分数的那一章,很有趣的,可以看看! wayne应该是湖北人吧,在北京读书?