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.

A306638 a(n) is the norm of the fundamental unit of binary quadratic forms with discriminant D = A079896(n).

Original entry on oeis.org

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

Views

Author

Jianing Song, Mar 02 2019

Keywords

Comments

The fundamental unit of binary quadratic forms with discriminant D is the number (x_1 + (y_1)*sqrt(D))/2, where (x_1,y_1) is the smallest solution to x^2 - D*y^2 = +-4. Each term is either -1 or 1 depending on whether (x_1)^2 - D*(y_1)^2 = -4 or 4.
All solutions to x^2 - D*y^2 = +-4 are given by the identity (x_n + (y_n)*sqrt(D))/2 = ((x_1 + (y_1)*sqrt(D))/2)^n.
The discriminants D corresponding to (x_1)^2 - D*(y_1)^2 = -4 are listed in A226696.

Examples

			Fundamental units and their norms for the first 15 discriminants in the form (X + Y*sqrt(D))/2 (N = (X^2 - D*Y^2)/4 are the corresponding norms) are:
   D |  X |  Y |  N
   5 |  1 |  1 | -1
   8 |  2 |  1 | -1
  12 |  4 |  1 |  1
  13 |  3 |  1 | -1
  17 |  8 |  2 | -1
  20 |  4 |  1 | -1
  21 |  5 |  1 |  1
  24 | 10 |  2 |  1
  28 | 16 |  3 |  1
  29 |  5 |  1 | -1
  32 |  6 |  1 |  1
  33 | 46 |  8 |  1
  37 | 12 |  2 | -1
  40 |  6 |  1 | -1
  41 | 64 | 10 | -1
		

References

  • D. A. Buell, Binary Quadratic Forms, Springer, 1989, Sections 3.2 and 3.3, pp. 31-48.

Crossrefs

A014077 is a subsequence listing the corresponding values for only fundamental discriminants (A003658).

Programs

  • Julia
    using Nemo
    function b(D)
        for j in 1:10000
            issquare(D*j^2 - 4) && return -1
            issquare(D*j^2 + 4) && return 1
        end
    0 end
    F = findall(n -> ZZ(n) % 4 <= 1 && !issquare(ZZ(n)), 1:100)
    map(n -> b(ZZ(n)), F) |> println # Peter Luschny, Mar 08 2019
  • PARI
    b(D) = for(n=1, oo, if(issquare(D*n^2-4), return(-1)); if(issquare(D*n^2+4), return(1)))
    for(n=2, 200, if(n%4 <= 1 && !issquare(n), print1(b(n), ", ")))
    

Formula

a(n) = -1 if D = A079896(n) is in A226696, otherwise 1.

Extensions

Offset changed to 1 by Robin Visser, Jun 09 2025