cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A362373 a(0) = 0; for n > 0, if n appears in the sequence then a(n) is the sum of the indices of all previous appearances of n. Otherwise a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n.

Original entry on oeis.org

0, 1, 3, 2, 6, 11, 4, 11, 19, 10, 9, 12, 11, 24, 38, 23, 7, 24, 42, 8, 28, 49, 27, 15, 30, 5, 31, 22, 20, 49, 24, 26, 58, 25, 59, 94, 130, 93, 14, 53, 13, 54, 18, 61, 17, 62, 16, 63, 111, 50, 49, 100, 48, 39, 41, 96, 40, 97, 32, 34, 94
Offset: 0

Views

Author

Kelvin Voskuijl, Apr 17 2023

Keywords

Comments

Conjecture: All nonnegative integers appear in this sequence. - Yifan Xie, Apr 24 2023

Examples

			a(2) = 3 = n, thus a(3) = 2.
a(5) = 11, as 5 has not previously appeared in the sequence, but a(4) - 5 = 1 has, thus a(5) = a(4) + 5 = 6 + 5 = 11.
a(5) and a(7) = 11, and 5 + 7 = 12, thus a(11) = 12.
		

Crossrefs

Programs