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.

Showing 1-2 of 2 results.

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

A068718 Boustrophedon transform of A068717 with A068717(1) = -1 instead of 0.

Original entry on oeis.org

1, 2, 2, 2, 8, 25, 90, 404, 2055, 11792, 75053, 525622, 4015361, 33231679, 296182315, 2828335731, 28809181418, 311788442591, 3572832236720, 43216177809190, 550245463265240, 7356239983352887, 103028812072639378
Offset: 0

Views

Author

Frank Ellermann, Feb 26 2002

Keywords

Comments

Signs omitted, all terms < 0. A068717(1) = -1 means soluble (1*1 -1*0*0 = +1 resp. 0*0 -1*1*1 = -1).

Crossrefs

Programs

  • 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]
    A068718_list = list(islice(A068718_gen(),40)) # Chai Wah Wu, Jun 14 2022
Showing 1-2 of 2 results.