A073629 a(1) = 1; a(2) =2; a(3) = 3; a(n) = smallest number greater than the previous term such that the sum of four successive terms is a prime.
1, 2, 3, 5, 7, 8, 9, 13, 17, 20, 21, 25, 31, 32, 39, 47, 49, 56, 59, 63, 73, 74, 83, 87, 93, 96, 97, 103, 105, 114, 117, 121, 127, 134, 139, 141, 143, 146, 147, 151, 155, 160, 165, 167, 169, 172, 175, 185, 187, 192, 193, 197, 205, 214, 223, 235, 239, 240, 253, 259, 261
Offset: 1
Keywords
Examples
a(4)=5 as 1+2+3+5=11 is prime, 1+2+3+4=10 composite
Programs
-
Mathematica
nxt[{a_,b_,c_}]:=Module[{k=c+1},While[!PrimeQ[a+b+c+k],k++];{b,c,k}]; Transpose[NestList[ nxt[#]&,{1,2,3},70]][[1]] (* Harvey P. Dale, Aug 29 2012 *)
Extensions
Corrected and extended by Sam Alexander, Feb 26 2005