A335382 a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) - sigma(n) if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + sigma(n), where sigma(n) is the sum of the divisors of n.
0, 1, 4, 8, 15, 9, 21, 13, 28, 41, 23, 11, 39, 25, 49, 73, 42, 24, 63, 43, 85, 53, 17, 41, 101, 70, 112, 72, 16, 46, 118, 86, 149, 197, 143, 95, 186, 148, 88, 32, 122, 80, 176, 132, 48, 126, 54, 6, 130, 187, 94, 22, 120, 66, 186, 114, 234, 154, 64, 124, 292, 230, 134, 30, 157, 241, 97, 29, 155
Offset: 0
Keywords
Examples
a(2) = 4. As sigma(2) = 3, and a(1)<3, a(2) = a(1) + 3 = 4. a(4) = 15. As sigma(4) = 7, and 1 has previously appeared, a(4) = a(3) + 7 = 15. a(5) = 9. As sigma(5) = 6, and 9 has not previously appeared, a(5) = a(4) - 6 = 9.
Comments