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.

A330385 Add the odd terms and subtract the even ones, the result must always be a square. This is the lexicographically earliest sequence of distinct positive integers with this property.

Original entry on oeis.org

1, 3, 4, 9, 7, 12, 5, 8, 15, 16, 25, 11, 13, 24, 39, 17, 19, 21, 23, 44, 36, 28, 20, 33, 40, 27, 32, 45, 48, 35, 85, 72, 51, 64, 133, 87, 60, 29, 31, 105, 123, 84, 41, 43, 141, 96, 47, 49, 159, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 164, 156
Offset: 1

Views

Author

Rémy Sigrist, Dec 12 2019

Keywords

Comments

This sequence is a variant of A329544.
All terms belong to A042965.

Examples

			The first terms, alongside the corresponding running totals, are:
  n   a(n)  t(n)
  --  ----  --------
   1     1   1 = 1^2
   2     3   4 = 2^2
   3     4   0 = 0^2
   4     9   9 = 3^2
   5     7  16 = 4^2
   6    12   4 = 2^2
   7     5   9 = 3^2
   8     8   1 = 1^2
   9    15  16 = 4^2
  10    16   0 = 0^2
  11    25  25 = 5^2
		

Crossrefs

Cf. A000290, A042965, A329544, A330386 (running totals).

Programs

  • PARI
    s=t=0; for (n=1, 65, for (v=1, oo, if (!bittest(s,v) && issquare(u=t-v*(-1)^v), print1 (v", "); s+=2^v; t=u; break)))