A336760 a(0) = 0; for n > 0, a(n) = a(n-1) - tau(n) if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + tau(n), where tau(n) is the number of divisors of n.
0, 1, 3, 5, 2, 4, 8, 6, 10, 7, 11, 9, 15, 13, 17, 21, 16, 14, 20, 18, 12, 16, 20, 22, 30, 27, 23, 19, 25, 27, 35, 33, 39, 43, 47, 51, 42, 40, 36, 32, 24, 26, 34, 36, 42, 48, 44, 46, 56, 53, 59, 55, 49, 51, 59, 63, 71, 67, 71, 69, 57, 59, 63, 69, 62, 58, 50, 52, 58, 54, 62, 60, 72, 70, 66, 72
Offset: 0
Keywords
Examples
a(2) = 3. As 2 has two divisors, a(2) = a(1) + 2 = 1 + 2 = 3. a(4) = 2. As 4 has three divisors, and as 2 has not been previously visited and is nonnegative, a(4) = a(3) - 3 = 5 - 3 = 2.
Comments