login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Sum of any four successive terms is prime, a(1)=a(2)=0,a(3)=1.
1

%I #24 Sep 01 2024 09:36:47

%S 0,0,1,1,1,2,3,5,3,6,5,9,9,8,11,13,11,12,17,19,13,18,21,21,19,22,27,

%T 29,23,24,31,31,27,38,35,37,29,48,37,43,35,52,43,49,37,62,45,53,39,74,

%U 57,57,41,78,63,59,51,84,69,65,53,90,73,67,63,104,77,69,67,118,83,79,69

%N Sum of any four successive terms is prime, a(1)=a(2)=0,a(3)=1.

%H Harvey P. Dale, <a href="/A103781/b103781.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A000040(n-3) - a(n-1) - a(n-2) - a(n-3). - _Jason Yuen_, Sep 01 2024

%t (*seed*)b4 = {0, 0, 1}; Do[x = Prime[n] - (b4[[ -1]] + b4[[ -2]] + b4[[ -3]]); b4 = Append[b4, x], {n, 1, 200}]; b4

%t nxt[{a_, b_, c_}] := {b, c, NextPrime[a + b + c] - (a+b + c)}; NestList[nxt, {0, 0, 1}, 100][[All, 1]] (* _Harvey P. Dale_, Sep 20 2022 *)

%Y Cf. A000040, A073737, A083242.

%K nonn,easy

%O 1,6

%A _Zak Seidov_, Feb 15 2005