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.

A154782 Least integer y>=0 such that n+2y^2 is a square; -1 if n is not in A035251.

Original entry on oeis.org

0, 0, 1, -1, 0, -1, -1, 1, 2, 0, -1, -1, -1, -1, 1, -1, 0, 2, 3, -1, -1, -1, -1, 1, -1, 0, -1, -1, 2, -1, -1, 3, 4, -1, 1, -1, 0, -1, -1, -1, -1, 2, -1, -1, -1, -1, 3, 1, -1, 0, 5, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, 1, 3, 0, -1, -1, -1, 4, -1, -1, 5, 6, 2, -1, -1, -1, -1, -1, 1, -1, 0
Offset: 0

Views

Author

M. F. Hasler, Jan 19 2009

Keywords

Crossrefs

Cf. A035251.

Programs

  • PARI
    A154782(n)={for(y=0,sqrtint(n\2),issquare(n+2*y^2)&return(y));-1}