login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(1) = 1; for n > 1, a(n) is the maximum positive k such that all terms a(t), a(t-m), a(t-2*m), ..., a(t-(k-1)*m), for 0<t<n and any m>=1, are equal.
2

%I #16 Oct 18 2023 10:05:56

%S 1,1,2,1,2,2,2,3,1,2,3,2,3,2,3,3,3,4,1,2,3,4,2,3,4,2,3,4,3,4,3,4,3,4,

%T 4,4,5,1,2,3,4,5,2,3,4,5,2,3,4,5,3,4,5,3,4,5,3,4,5,4,5,4,5,4,5,4,5,5,

%U 5,6,1,2,3,4,5,6,2,3,4,5,6,2,3,4,5,6,3,4,5,6,3,4,5,6,3,4,5,6,4

%N a(1) = 1; for n > 1, a(n) is the maximum positive k such that all terms a(t), a(t-m), a(t-2*m), ..., a(t-(k-1)*m), for 0<t<n and any m>=1, are equal.

%C The terms form quickly form a repetitive pattern of arithmetic progressions of increasing length, see the graph. This leads to any given value t eventually being in a progression of length t+1 which then never increases.

%C See A366724 for the index where a number first appears.

%H Scott R. Shannon, <a href="/A366574/b366574.txt">Table of n, a(n) for n = 1..10000</a>

%e a(3) = 2 as a(2) = 1 and a(2) = a(1) = 1.

%e a(11) = 3 as a(10) = 2 and a(7) = a(6) = a(5) = 2.

%e a(18) = 4 as a(17) = 3 and a(17) = a(15) = a(13) = a(11) = 3.

%Y Cf. A366724, A178976, A308638, A229037.

%K nonn

%O 1,3

%A _Scott R. Shannon_, Oct 13 2023