シーケンス定義
a(n)
次のように正の整数のシーケンスを作成します。
a(0) = 4
a(n)
最初の項以外の各項は、次を満たす最小の数値です。a
)a(n)
は合成数、
b)a(n) > a(n-1)
および
c)a(n) + a(k) + 1
はそれぞれの合成数です0 <= k < n
。
だから私たちはで始まりa(0) = 4
ます。次のエントリはでa(1)
なければなりません9
。それらは合成できない5
か7
、合成できないため、合成できない6
か合成でない8
ため、合成できないか、合成できないから6+4+1=11
です8+4+1=13
。最後に、、9+4+1=14
これは複合a(1) = 9
です。
次のエントリはであるa(2)
必要があります。これは、両方のコンポジット10
よりも大きい最小の番号だからです。9
10+9+1=20
10+4+1=15
次のエントリについては、それらは複合ではないため両方11
と13
も出ています。複合ではない12
ため12+4+1=17
です。複合ではない14
ため14+4+1=19
です。したがって、15
のでシーケンスの次の用語である15
複合材であり15+4+1=20
、15+9+1=25
及び15+10+1=26
従って、全て各複合ありますa(3) = 15
。
このシーケンスの最初の30の用語は次のとおりです。
4, 9, 10, 15, 16, 22, 28, 34, 35, 39, 40, 46, 52, 58, 64, 70, 75, 76, 82, 88, 94, 100, 106, 112, 118, 119, 124, 125, 130, 136
これはOEIS A133764です。
チャレンジ
入力整数を指定するとn
、n
このシーケンスのth番目の項を出力します。