Numbers n such that 2 * n^2 - 1 is a square(2)
オンライン整数列大辞典の
A001652(http://oeis.org/A001652/list)、
A046090(http://oeis.org/A046090/list)
と比較し、答え合わせしてみる。
と比較し、答え合わせしてみる。
また、
23660^2 + 23661^2 = 33461^2
のような関係が成り立つことを確認してみる。
出力結果
true
true
[0, 1, 1, true]
[3, 4, 5, true]
[20, 21, 29, true]
[119, 120, 169, true]
[696, 697, 985, true]
[4059, 4060, 5741, true]
[23660, 23661, 33461, true]
[137903, 137904, 195025, true]
[803760, 803761, 1136689, true]
[4684659, 4684660, 6625109, true]
[27304196, 27304197, 38613965, true]
[159140519, 159140520, 225058681, true]
[927538920, 927538921, 1311738121, true]
[5406093003, 5406093004, 7645370045, true]
[31509019100, 31509019101, 44560482149, true]
[183648021599, 183648021600, 259717522849, true]
[1070379110496, 1070379110497, 1513744654945, true]
[6238626641379, 6238626641380, 8822750406821, true]
[36361380737780, 36361380737781, 51422757785981, true]
[211929657785303, 211929657785304, 299713796309065, true]
[1235216565974040, 1235216565974041, 1746860020068409, true]
def A001652(n)
a, b, c = 0, 3, 20
ary = [a, b, c]
while ary.size < n + 1
a, b, c = b, c, 6 * c - b + 2
ary << c
end
ary[0..n]
end
def A046090(n)
a, b, c = 1, 4, 21
ary = [a, b, c]
while ary.size < n + 1
a, b, c = b, c, 6 * c - b - 2
ary << c
end
ary[0..n]
end
def A001653(n)
a, b, c = 1, 5, 29
ary = [a, b, c]
while ary.size < n
a, b, c = b, c, 6 * c - b
ary << c
end
ary[0..n - 1]
end
a_ary = A001652(20)
# OEIS A001652のデータ
a_ary0 =
[0,3,20,119,696,4059,23660,137903,803760,4684659,
27304196,159140519,927538920,5406093003,
31509019100,183648021599,1070379110496,
6238626641379,36361380737780,211929657785303,
1235216565974040]
# 一致の確認
p a_ary == a_ary0
b_ary = A046090(20)
# OEIS A046090のデータ
b_ary0 =
[1,4,21,120,697,4060,23661,137904,803761,4684660,
27304197,159140520,927538921,5406093004,
31509019101,183648021600,1070379110497,
6238626641380,36361380737781,211929657785304,
1235216565974041]
# 一致の確認
p b_ary == b_ary0
c_ary = A001653(21)
(0..20).each{|i|
a, b, c = a_ary[i], b_ary[i], c_ary[i]
p [a, b, c, a * a + b * b == c * c]
}
出力結果
true
true
[0, 1, 1, true]
[3, 4, 5, true]
[20, 21, 29, true]
[119, 120, 169, true]
[696, 697, 985, true]
[4059, 4060, 5741, true]
[23660, 23661, 33461, true]
[137903, 137904, 195025, true]
[803760, 803761, 1136689, true]
[4684659, 4684660, 6625109, true]
[27304196, 27304197, 38613965, true]
[159140519, 159140520, 225058681, true]
[927538920, 927538921, 1311738121, true]
[5406093003, 5406093004, 7645370045, true]
[31509019100, 31509019101, 44560482149, true]
[183648021599, 183648021600, 259717522849, true]
[1070379110496, 1070379110497, 1513744654945, true]
[6238626641379, 6238626641380, 8822750406821, true]
[36361380737780, 36361380737781, 51422757785981, true]
[211929657785303, 211929657785304, 299713796309065, true]
[1235216565974040, 1235216565974041, 1746860020068409, true]
0 件のコメント:
コメントを投稿
注: コメントを投稿できるのは、このブログのメンバーだけです。