%I #9 Oct 11 2021 18:59:41
%S 2,1,1,3,2,1,1,3,1,5,2,1,1,3,1,5,2,1,1,3,1,5,2,1,3,3,1,5,2,1,1,3,1,5,
%T 1,4,2,1,7,3,3,1,1,7,4,9,4,1,5,1,10,5,3,1,3,9,2,1,1,3,2,1,3,3,13,2,5,
%U 2,5,1,1,4,2,1,6,3,33,2,5,1,5,4,3,1,4,8,4,1,1,7,1,5,10,16,3,1
%N a(1) = 2; for n > 1, let a(k) be a divisor > 1 of n appearing in all previous terms where k is as large as possible. Then a(n) = n - k. If no such k exists then a(n) = n - m, where a(m) = 1 and m is as large as possible.
%C The sequence shows long runs of 2 appearing as every second term separated with larger values, corresponding to the offset for the odd-numbered divisors. These are eventually broken when an even number is divisible by the previous odd-numbered offset term. See the linked image.
%C The largest value in the first 10^6 terms is 291774, and in the same range the smallest number not yet seen is 2919. It is likely all numbers eventually appear although this is unknown. In the same range, the only composite number whose divisors > 1 have not appeared in the sequence is 121, i.e., 11 has not appeared before a(121), thus a(121) = 1 as a(120) = 1.
%H Scott R. Shannon, <a href="/A348285/a348285.png">Image of the first 10^6 terms</a>.
%e a(2) = 1 as the last divisor > 1 of 2 so far appearing is a(1) = 2, and that is 2 - 1 = 1 term back from 2.
%e a(3) = 1 as 3 is prime, thus the offset to the last 1 term, a(2), is 3 - 2 = 1.
%e a(4) = 3 as the last divisor of 4 > 1 so far appearing is a(1) = 2, and that is 4 - 1 = 3 terms back from 4.
%e a(6) = 1 as the last divisor of 6 > 1 so far appearing is a(5) = 2, and that is 6 - 5 = 1 term back from 6.
%Y Cf. A027750, A348217, A341679, A181391.
%K nonn
%O 1,1
%A _Scott R. Shannon_, Oct 09 2021