login
A348285
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.
1
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, 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, 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
OFFSET
1,1
COMMENTS
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.
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.
EXAMPLE
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.
a(3) = 1 as 3 is prime, thus the offset to the last 1 term, a(2), is 3 - 2 = 1.
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.
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.
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Oct 09 2021
STATUS
approved