OFFSET
1,2
COMMENTS
This is a variation of A337490; here we start with an offset of 1, so a(1) = 1. See that sequence for further details.
In the first 4212 terms the sequence decreases 69 times while 45 terms are repeated, the first being 13 at n=9 and the last 399876 at n=4212. After n(4166)=84 the sequence does not decrease again for n up to at least 100 million. The lowest numbers that have not appeared in that range are 30,37,47,48,49,51. The 100 millionth term is 4999999941527298.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..10000
Scott R. Shannon, Graph of the terms for n=1..4500. This includes the last known decrease in the sequence, n(4166)=84.
EXAMPLE
a(2) = 3 as the sum of all previous terms is a(1) = 1, and the GCD of 1 and 2 is 1. However 1 has already appeared so a(2) = a(1) + n = 1 + 2 = 3.
a(4) = 2 as the sum of all previous terms is a(1)+a(2)+a(3) = 10, and the GCD of 10 and 4 is 2, and as 2 has not previous appeared a(4) = 2.
a(8) = 4 as the sum of all previous terms is a(1)+...+a(7) = 52, and the GCD of 52 and 8 is 4, and as 4 has not previous appeared a(8) = 4.
PROG
(PARI) lista(nn) = {my(va = vector(nn), s=0); va[1] = 1; s += va[1]; for (n=2, nn, my(g = gcd(n, s)); if (#select(x->(x==g), va), va[n] = va[n-1]+n, va[n] = g); s += va[n]; ); va; } \\ Michel Marcus, Sep 05 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Sep 03 2020
STATUS
approved