login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A068717 a(n) = -1 if A067280(n) == 0 (mod 2), otherwise a(n) = A049240(n). 4
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Previous name was: x*x - n*y*y = +-1 has infinitely many solutions in integers (x,y).
REFERENCES
H. Davenport, The Higher Arithmetic. Cambridge Univ. Press, 7th ed., 1999, table 1.
LINKS
FORMULA
a(n) = -1 if A067280(n) == 0 (mod 2), otherwise a(n) = A049240(n).
EXAMPLE
a(2)= -1: x*x - 2*y*y = -1 is soluble, e.g., 7*7 - 2*5*5 = -1.
PROG
(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
CROSSREFS
Sequence in context: A348737 A285418 A344617 * A049240 A285978 A138712
KEYWORD
sign,easy
AUTHOR
Frank Ellermann, Feb 25 2002
EXTENSIONS
New name from formula by Joerg Arndt, Aug 29 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 6 11:04 EDT 2024. Contains 372293 sequences. (Running on oeis4.)