OFFSET
0,2
COMMENTS
The sequence displays the unusual behavior of decreasing 53 times in the first 1975 terms, due to the existence of a GCD which has not previously appeared in the sequence, but then not decreasing again for n up to at least 100 million. In this period there are 37 repeated terms, the first being 21 at n=11 and the last 161202 at n=2054. In the same range many values do not appear, for example 16,23,28,32,36. It is unknown when the sequence decreases again, or if all values eventually appear. The 100 millionth term is 4999999948050717.
See the companion sequence A333980 for the sum of the terms from a(0) to a(n).
LINKS
Scott R. Shannon, Table of n, a(n) for n = 0..10000
Scott R. Shannon, Graph of the terms for n=0..2500. This includes the last known decrease in the sequence, n(1974) = 42.
Scott R. Shannon, Graph of the terms for n=0..10000000.
EXAMPLE
a(2) = 4 as the sum of all previous terms is a(0)+a(1) = 3, and the GCD of 3 and 2 is 1, which has already appeared in the sequence. Therefore a(2) = a(1) + n = 2 + 2 = 4.
a(4) = 11 as the sum of all previous terms is a(0)+...+a(3) = 14, and the GCD of 14 and 4 is 2. However 2 has already appeared so a(4) = a(3) + n = 7 + 4 = 11.
a(5) = 5 as the sum of all previous terms is a(0)+...+a(4) = 25, and the GCD of 25 and 5 is 5, and as 5 has not previous appeared a(5) = 5.
PROG
(PARI) lista(nn) = {my(va = vector(nn), s=0); va[1] = 1; s += va[1]; for (n=2, nn, my(g = gcd(n-1, s)); if (#select(x->(x==g), va), va[n] = va[n-1]+n-1, va[n] = g); s += va[n]; ); va; } \\ Michel Marcus, Sep 05 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Aug 29 2020
STATUS
approved