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.

A068717 a(n) = -1 if A067280(n) == 0 (mod 2), otherwise a(n) = A049240(n).

Original entry on oeis.org

0, -1, 1, 0, -1, 1, 1, 1, 0, -1, 1, 1, -1, 1, 1, 0, -1, 1, 1, 1, 1, 1, 1, 1, 0, -1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 0, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 0, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 0, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 0, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Frank Ellermann, Feb 25 2002

Keywords

Comments

Previous name was: x*x - n*y*y = +-1 has infinitely many solutions in integers (x,y).

Examples

			a(2)= -1: x*x - 2*y*y = -1 is soluble, e.g., 7*7 - 2*5*5 = -1.
		

References

  • H. Davenport, The Higher Arithmetic. Cambridge Univ. Press, 7th ed., 1999, table 1.

Crossrefs

Programs

  • Python
    from math import isqrt
    from sympy import continued_fraction_periodic
    def A068717(n): return 0 if (a:=isqrt(n)**2==n) else (-1 if len(continued_fraction_periodic(0,1,n)[1]) & 1 else 1-int(a)) # Chai Wah Wu, Jun 14 2022

Formula

a(n) = -1 if A067280(n) == 0 (mod 2), otherwise a(n) = A049240(n).

Extensions

New name from formula by Joerg Arndt, Aug 29 2020