A240556 Earliest nonnegative increasing sequence with no 5-term subsequence of constant third differences.
0, 1, 2, 3, 5, 7, 11, 15, 16, 27, 47, 48, 64, 95, 175, 196, 211, 212, 214, 247, 249, 252, 398, 839, 1002, 1014, 1016, 1035, 1036, 1037, 1051, 1054, 1072, 1121, 1143, 1146, 1172, 1258, 4271, 4282, 4284, 4336, 4571, 4578, 4582, 4598, 4613, 4622, 4628, 4646
Offset: 1
Keywords
Examples
After (0, 1, 2, 3, 5, 7), the number 10 is excluded since else the subsequence (0, 2, 3, 5, 10) would have successive 1st, 2nd and 3rd differences (2, 1, 2, 5), (-1, 1, 3) and (2, 2), which is constant and thus excluded.
Crossrefs
Cf. A240557 (starting with 1).
Programs
-
Mathematica
t = {0, 1, 2, 3}; Do[s = Table[Append[i, n], {i, Subsets[t, {4}]}]; If[! MemberQ[Flatten[Table[Differences[i, 4], {i, s}]], 0], AppendTo[t, n]], {n, 4, 5000}]; t
-
PARI
A240556(n,show=0,L=5,o=3,v=[0],D=v->v[2..-1]-v[1..-2])={ my(d,m); while( #v
1,);#Set(d)>1||next(2),2);break));v[#v]} \\ M. F. Hasler, Jan 12 2016
Comments