OFFSET
0,2
COMMENTS
Signs omitted, all terms < 0. A068717(1) = -1 means soluble (1*1 -1*0*0 = +1 resp. 0*0 -1*1*1 = -1).
PROG
(Python)
from itertools import accumulate, count, islice
from math import isqrt
from sympy import continued_fraction_periodic
def A068718_gen(): # generator of terms
yield 1
blist = (1, )
for n in count(2):
yield (blist := tuple(accumulate(reversed(blist), initial=0 if (a:=isqrt(n)**2==n) else (1 if len(continued_fraction_periodic(0, 1, n)[1]) & 1 else int(a)-1))))[-1]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Frank Ellermann, Feb 26 2002
STATUS
approved