OFFSET
0,1
COMMENTS
The first term corresponds to the number of terms before zero in A079777. This sequence starts at n and counts the number of terms before zero using the same iterative formula.
The sequence shows large variations in its value, e.g., a(496) = 222, a(497) = 1087851. In the first 50000 terms the largest value is a(21897) = 1248976431. In the same range the smallest number greater than 1 not to have appeared is 414, although it is likely all numbers eventually appear.
LINKS
Scott R. Shannon, Line graph of the first 50000 terms.
EXAMPLE
a(0) = 5 as starting at 0 and 1 gives 0+1 % 2 = 1, 1+1 % 3 = 2, 1+2 % 4 = 3, 2+3 % 5 = 0, with five terms before reaching zero. See A079777.
a(1) = 2 as starting at 1 and 2 gives 1+2 % 3 = 0, with two terms before reaching zero. This is the smallest possible value and the only term to equal 2.
a(2) = 7 as starting at 2 and 3 gives 2+3 % 4 = 1, 3+1 % 5 = 4, 1+4 % 6 = 5, 4+5 % 7 = 2, 5+2 % 8 = 7, 2+7 % 9 = 0, with seven terms before reaching zero.
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Mar 15 2022
STATUS
approved