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.
%I A068717 #17 Jun 15 2022 01:49:57 %S A068717 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, %T A068717 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, %U A068717 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 %N A068717 a(n) = -1 if A067280(n) == 0 (mod 2), otherwise a(n) = A049240(n). %C A068717 Previous name was: x*x - n*y*y = +-1 has infinitely many solutions in integers (x,y). %D A068717 H. Davenport, The Higher Arithmetic. Cambridge Univ. Press, 7th ed., 1999, table 1. %H A068717 John Robertson, <a href="https://web.archive.org/web/20051102095831/http://hometown.aol.com/jpr2718/pell.pdf">Solving the generalized Pell equation x^2-dy^2=N</a>. %F A068717 a(n) = -1 if A067280(n) == 0 (mod 2), otherwise a(n) = A049240(n). %e A068717 a(2)= -1: x*x - 2*y*y = -1 is soluble, e.g., 7*7 - 2*5*5 = -1. %o A068717 (Python) %o A068717 from math import isqrt %o A068717 from sympy import continued_fraction_periodic %o A068717 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 %Y A068717 Cf. A068716, A068718, A067280, A049240, A006702, A006703. %K A068717 sign,easy %O A068717 1,1 %A A068717 _Frank Ellermann_, Feb 25 2002 %E A068717 New name from formula by _Joerg Arndt_, Aug 29 2020