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, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn
AUTHOR
Samuel Harkness, May 07 2023
STATUS
approved