This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A362881 #43 Jan 06 2024 10:19:16 %S A362881 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, %T A362881 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, %U A362881 3,5,3,6,4,3,4,3,6,3,6,4,3,5,3,5,3,4,3 %N A362881 a(n) is the length of the longest arithmetic progression ending at a(n-1); a(1)=1. %C A362881 Progressions are terms at indices which are in arithmetic progression and with values which are in arithmetic progression too. %C A362881 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? %C A362881 This sequence is unbounded (this is a consequence of Van der Waerden's theorem). - _Rémy Sigrist_, May 14 2023 %H A362881 Samuel Harkness, <a href="/A362881/b362881.txt">Table of n, a(n) for n = 1..10000</a> %H A362881 Samuel Harkness, <a href="/A362881/a362881.m.txt">MATLAB program</a>. %H A362881 OEIS Wiki, <a href="/wiki/Ordinal_transform">Ordinal transform</a>. %H A362881 Neal Gersh Tolunsky, <a href="/A362881/a362881_1.png">Graph of the ordinal transform of the first 10000 terms</a>, with lines labeled by corresponding values of this sequence. %H A362881 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/vanderWaerdensTheorem.html">Van der Waerden's Theorem</a>. %e A362881 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. %e A362881 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. %t A362881 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 *) %o A362881 (MATLAB) See Links section. %Y A362881 Cf. A308638, A362909 (indices of record highs). %K A362881 nonn %O A362881 1,3 %A A362881 _Samuel Harkness_, May 07 2023