login
A362881
a(n) is the length of the longest arithmetic progression ending at a(n-1); a(1)=1.
3
1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 3, 2, 3, 2, 3, 3, 3, 4, 3, 5, 4, 3, 4, 3, 3, 5, 3, 3, 6, 3, 3, 7, 4, 3, 8, 5, 3, 9, 6, 4, 3, 3, 3, 7, 3, 3, 4, 3, 4, 3, 4, 3, 6, 3, 5, 3, 6, 2, 3, 4, 3, 7, 3, 5, 3, 4, 3, 5, 3, 6, 4, 3, 4, 3, 6, 3, 6, 4, 3, 5, 3, 5, 3, 4, 3
OFFSET
1,3
COMMENTS
Progressions are terms at indices which are in arithmetic progression and with values which are in arithmetic progression too.
In the first 10^6 terms, no 2's occur after a(60) and no 3's occur after a(2746). Can it be proved that no more will occur after these values? For any k in the sequence, is there a term where k occurs for the final time?
This sequence is unbounded (this is a consequence of Van der Waerden's theorem). - Rémy Sigrist, May 14 2023
LINKS
Samuel Harkness, MATLAB program.
OEIS Wiki, Ordinal transform.
Neal Gersh Tolunsky, Graph of the ordinal transform of the first 10000 terms, with lines labeled by corresponding values of this sequence.
Eric Weisstein's World of Mathematics, Van der Waerden's Theorem.
EXAMPLE
For n = 13, the longest arithmetic progression ending at a(12) is {a(4), a(8), a(12)} = {2, 3, 4}, which has length 3, so a(13) = 3.
For n = 28, the longest arithmetic progression ending at a(27) is {a(15), a(18), a(21), a(24), a(27)} = {3, 3, 3, 3, 3}, which has length 5, so a(28) = 5.
MATHEMATICA
a[nmax_Integer] := Module[{K, r, f, d}, K = ConstantArray[0, nmax]; K[[1 ;; 2]] = {1, 1}; For[n = 3, n <= nmax, n++, r = 1; For[b = 1, b <= n - 2, b++, d = K[[n - 1 - b]] - K[[n - 1]]; f = 2; While[n - 1 - f*b > 0 && K[[n - 1 - f*b]] - K[[n - 1 - (f - 1)*b]] == d, f = f + 1; ]; If[f > r, r = f]; ]; K[[n]] = r; ]; K]; a[87] (* Robert P. P. McKone, Aug 24 2023 *)
PROG
(MATLAB) See Links section.
CROSSREFS
Cf. A308638, A362909 (indices of record highs).
Sequence in context: A089051 A364631 A331255 * A317359 A375423 A108229
KEYWORD
nonn
AUTHOR
Samuel Harkness, May 07 2023
STATUS
approved