OFFSET
2,3
COMMENTS
Taken from Cohen's table on pages 515-519. The table is indexed by the discriminant d = d(K) = A003658(n) of the real quadratic fields K. The fundamental unit is given as a pair of coordinates (a,b) = (A014000(n), A014046(n)) expressed in terms of the canonical integral basis (1,w) where w = (1+sqrt(d))/2 if d == 1 (mod 4), w = sqrt(d)/2 if d == 0 (mod 4).
The norm of this fundamental unit is A014077(n). The class number h(K) is A003652(n). - N. J. A. Sloane, Jun 14 2013
If (x0,y0) is the smallest positive solution to x^2 - D*y^2 = +-4, D = A003658(n), then a(n) = x_0/2 if D == 0 (mod 4), (x_0-y_0)/2 if D == 1 (mod 4). Note that y0 is given by A014046(n). - Jianing Song, Mar 23 2026
REFERENCES
H. Cohen, A Course in Computational Algebraic Number Theory, Springer, 1993, pp. 515-519.
LINKS
Jianing Song, Table of n, a(n) for n = 2..10000
S. R. Finch, Class number theory [Cached copy, with permission of the author]
Keith Matthews, Finding the fundamental unit of a real quadratic field
EXAMPLE
Here is the start of Cohen's list of fundamental units: [0, 1], [1, 1], [2, 1], [1, 1], [3, 2], [2, 1], [5, 2], [8, 3], [2, 1], [19, 8], [5, 2], [3, 1], [27, 10], [10, 3], [3, 1], [15, 4], [131, 40],[4, 1], [17, 5], [7, 2], [11, 3], [943, 250], [170, 39], [4, 1], [4, 1], [197, 42], [447, 106], [24, 5], [13, 3], [5035, 1138], [9, 2], [5, 1], [37, 8], [118, 25], [703, 146], [11, 2], [1520, 273], [15371, 2968], [79, 15], [35, 6], [1595, 298], [6, 1], [87, 16], [11, 2], [28, 5], [37, 6], [25, 4], [98, 17], [10847, 1856], [6, 1], [13, 2], [3482, 531], [6, 1], [57731, 9384], [604, 97], [24335, 3588], [63, 10], [48, 7], [1637147, 253970], [13, 2], [478763, 72664], ... [N. J. A. Sloane, Jun 14 2013]
PROG
(PARI) for(D=2, 200, if(isfundamental(D), print1(real(quadunit(D)), ", "))) \\ Jianing Song, Mar 22 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Rains (rains(AT)caltech.edu)
EXTENSIONS
Edited by N. J. A. Sloane, Jun 14 2013
Offset corrected by Jianing Song, Mar 31 2019
STATUS
approved
