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.

A349119 a(0) = 1; for n>0, a(n) is the smallest positive integer that has not previously occurred such that |n - a(n-1)| + a(n) is a square.

Original entry on oeis.org

1, 4, 2, 3, 8, 6, 9, 7, 15, 10, 16, 11, 24, 5, 27, 13, 22, 20, 14, 31, 25, 12, 26, 33, 40, 21, 44, 19, 55, 23, 18, 36, 32, 35, 48, 51, 34, 46, 17, 42, 47, 30, 37, 43, 63, 82, 28, 45, 61, 52, 62, 38, 50, 78, 57, 79, 41, 65, 29, 70, 39, 59, 97, 66, 98, 67, 80, 68, 49, 101, 69, 119, 53, 124, 71, 60
Offset: 0

Views

Author

Scott R. Shannon, Nov 08 2021

Keywords

Examples

			a(1) = 4 as |1 - a(0)| = |1 - 1| = 0, and 0 + 4 = 4 = 2^2 is the next smallest square. Note a(1) cannot be 1 as a(0) = 1.
a(4) = 8 as |4 - a(3)| = |4 - 3| = 1, and 1 + 8 = 9 = 3^2 is the next smallest square. Note a(4) cannot be 3 as a(3) = 3.
a(8) = 15 as |8 - a(7)| = |8 - 7| = 1, and 1 + 15 = 16 = 4^2 is the next smallest square. Note a(8) cannot be 3 or 8 as these have previously occurred.
		

Crossrefs