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.

A339952 Numbers that are the sum of an even square > 0 and an odd square.

Original entry on oeis.org

5, 13, 17, 25, 29, 37, 41, 45, 53, 61, 65, 73, 85, 89, 97, 101, 109, 113, 117, 125, 137, 145, 149, 153, 157, 169, 173, 181, 185, 193, 197, 205, 221, 225, 229, 233, 241, 245, 257, 261, 265, 269, 277, 281, 289, 293, 305, 313, 317, 325, 333, 337, 349, 353, 365, 369, 373, 377
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 24 2020

Keywords

Examples

			13 is in the sequence since it is the sum of an even square > 0 and an odd square, 2^2 + 3^2 = 4 + 9 = 13.
		

Crossrefs

Programs

  • Mathematica
    Table[If[Sum[Sign[(Mod[i, 2] Mod[n - i + 1, 2] + Mod[i + 1, 2] Mod[n - i, 2])] (Floor[Sqrt[i]] - Floor[Sqrt[i - 1]]) (Floor[Sqrt[n - i]] - Floor[Sqrt[n - i - 1]]), {i, Floor[n/2]}] > 0, n, {}], {n, 500}] // Flatten
  • Python
    def aupto(limit):
      m = int(limit**.5) + 2
      es = [i*i for i in range(2, m, 2)]
      os = [i*i for i in range(1, m, 2)]
      return sorted(set(a+b for a in es for b in os if a+b <= limit))
    print(aupto(377)) # Michael S. Branicky, May 13 2021