オンライン整数列大辞典の
A001951(http://oeis.org/A001951/list)、
A022838(http://oeis.org/A022838/list)、
A022839(http://oeis.org/A022839/list)、
A022840(http://oeis.org/A022840/list)、
A022841(http://oeis.org/A022841/list)、
A022842(http://oeis.org/A022842/list)、
A177102(http://oeis.org/A177102/list)
と比較し、答え合わせしてみる。
出力結果
true
true
true
true
true
true
true
A177102(http://oeis.org/A177102/list)
と比較し、答え合わせしてみる。
def A(m, n)
l = Math.sqrt(m)
(1..n).map{|i| (l * i).to_i}
end
ary = [0] + A(2, 71)
# OEIS A001951のデータ
ary0 =
[0,1,2,4,5,7,8,9,11,12,14,15,16,18,19,21,22,24,25,
26,28,29,31,32,33,35,36,38,39,41,42,43,45,46,48,
49,50,52,53,55,56,57,59,60,62,63,65,66,67,69,70,
72,73,74,76,77,79,80,82,83,84,86,87,89,90,91,93,
94,96,97,98,100]
# 一致の確認
p ary == ary0
ary = A(3, 65)
# OEIS A022838のデータ
ary0 =
[1,3,5,6,8,10,12,13,15,17,19,20,22,24,25,27,29,31,
32,34,36,38,39,41,43,45,46,48,50,51,53,55,57,58,
60,62,64,65,67,69,71,72,74,76,77,79,81,83,84,86,
88,90,91,93,95,96,98,100,102,103,105,107,109,110,
112]
# 一致の確認
p ary == ary0
ary = A(5, 61)
# OEIS A022839のデータ
ary0 =
[2,4,6,8,11,13,15,17,20,22,24,26,29,31,33,35,38,
40,42,44,46,49,51,53,55,58,60,62,64,67,69,71,73,
76,78,80,82,84,87,89,91,93,96,98,100,102,105,107,
109,111,114,116,118,120,122,125,127,129,131,134,
136]
# 一致の確認
p ary == ary0
ary = A(6, 60)
# OEIS A022840のデータ
ary0 =
[2,4,7,9,12,14,17,19,22,24,26,29,31,34,36,39,41,
44,46,48,51,53,56,58,61,63,66,68,71,73,75,78,80,
83,85,88,90,93,95,97,100,102,105,107,110,112,115,
117,120,122,124,127,129,132,134,137,139,142,144,
146]
# 一致の確認
p ary == ary0
ary = A(7, 59)
# OEIS A022841のデータ
ary0 =
[2,5,7,10,13,15,18,21,23,26,29,31,34,37,39,42,44,
47,50,52,55,58,60,63,66,68,71,74,76,79,82,84,87,
89,92,95,97,100,103,105,108,111,113,116,119,121,
124,126,129,132,134,137,140,142,145,148,150,153,
156]
# 一致の確認
p ary == ary0
ary = A(8, 58)
# OEIS A022842のデータ
ary0 =
[2,5,8,11,14,16,19,22,25,28,31,33,36,39,42,45,48,
50,53,56,59,62,65,67,70,73,76,79,82,84,87,90,93,
96,98,101,104,107,110,113,115,118,121,124,127,130,
132,135,138,141,144,147,149,152,155,158,161,164]
# 一致の確認
p ary == ary0
ary = A(10, 58)
# OEIS A177102のデータ
ary0 =
[3,6,9,12,15,18,22,25,28,31,34,37,41,44,47,50,53,
56,60,63,66,69,72,75,79,82,85,88,91,94,98,101,104,
107,110,113,117,120,123,126,129,132,135,139,142,
145,148,151,154,158,161,164,167,170,173,177,180,
183]
# 一致の確認
p ary == ary0
出力結果
true
true
true
true
true
true
true
0 件のコメント:
コメントを投稿
注: コメントを投稿できるのは、このブログのメンバーだけです。