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.

A330403 Lexicographically earliest sequence of distinct positive terms with an associate sequence t such that t(0) = 0, and for any n > 0, at least one of t(n-1) - a(n) or t(n-1) + a(n) is a square; in case t(n-1) - a(n) is a square, set t(n) = t(n-1) - a(n), otherwise set t(n) = t(n-1) + a(n).

Original entry on oeis.org

1, 3, 4, 9, 5, 12, 7, 8, 15, 16, 25, 11, 13, 24, 21, 32, 20, 33, 40, 27, 28, 17, 19, 36, 39, 56, 45, 35, 48, 49, 64, 55, 72, 63, 23, 57, 60, 77, 65, 84, 44, 52, 29, 31, 68, 37, 80, 41, 76, 99, 81, 95, 51, 69, 87, 105, 123, 43, 88, 47, 92, 141, 96, 129, 111, 93
Offset: 1

Views

Author

Rémy Sigrist, Dec 13 2019

Keywords

Comments

This sequence is a variant of A330385.

Examples

			The first terms, alongside t(n), are:
  n   a(n)  t(n)
  --  ----  ----
   0  N/A      0
   1     1     1
   2     3     4
   3     4     0
   4     9     9
   5     5     4
   6    12    16
   7     7     9
   8     8     1
   9    15    16
  10    16     0
  11    25    25
  12    11    36
		

Crossrefs

See A330401 for similar sequences.
Cf. A330385, A330422 (running totals).

Programs

  • PARI
    See Links section.