空でないリスト所与Lより大きい整数の1、我々は定義D(L)最小の正の整数であり、その結果として、N + D(L)である複合それぞれについてNでLを。
シーケンスa nを次のように定義します。
- 0 = 2
- a i + 1は、d(a 0、...、a i、a i + 1)> d(a 0、...、a i)となるようなa iより大きい最小の整数です
あなたのタスク
次のいずれかです。
- 整数Nを取り、シーケンスのN番目の項(0インデックスまたは1インデックス)を返します
- 整数Nを取り、シーケンスの最初のN項を返します
- 何も入力せずに、シーケンスを永久に印刷します
これはcode-golfなので、バイト単位の最短回答が勝ちです!
Nが大きくなるにつれてコードが遅くなっても問題ありませんが、少なくとも2分以内に20個の最初の用語を見つけるはずです。
最初の用語
- a 0 = 2およびd(2)= 2(2 + 2が合成されるように2を追加する必要があります)
- d(2、3)= 6であるため、a 1 = 3 ( 2 + 6と3 + 6が合成されるように6を追加する必要があります)
- d(2、3、5)= 7であるためa 2 = 5 (2 + 7、3 + 7、および5 + 7がすべて複合になるように7を追加する必要があります)、d(2、3、4)はまだです6に等しい
- 等
以下は、シーケンスの最初の100の用語です(投稿時のOEISでは不明)。
2, 3, 5, 6, 10, 15, 17, 19, 22, 24,
30, 34, 35, 39, 41, 47, 51, 54, 56, 57,
70, 79, 80, 82, 92, 98, 100, 103, 106, 111,
113, 116, 135, 151, 158, 162, 165, 179, 183, 186,
191, 192, 200, 210, 217, 223, 226, 228, 235, 240,
243, 260, 266, 274, 277, 284, 285, 289, 298, 307,
309, 317, 318, 329, 341, 349, 356, 361, 374, 377,
378, 382, 386, 394, 397, 405, 409, 414, 417, 425,
443, 454, 473, 492, 494, 502, 512, 514, 519, 527,
528, 560, 572, 577, 579, 598, 605, 621, 632, 642