OFFSET
2,2
COMMENTS
Let epsilon be the fundamental unit of K, then the quadratic order is Z[epsilon] if epsilon has norm 1, and Z[epsilon^2] is epsilon has norm -1.
If (x0,y0) is the smallest positive solution to x^2 - D*y^2 = 4, D = A003658(n), then a(n) = y0.
LINKS
Jianing Song, Table of n, a(n) for n = 2..10000
EXAMPLE
For D = A003658(3) = 8, we have O_K = Z[sqrt(2)], and the fundamental unit epsilon = 1+sqrt(2) has norm -1. The order generated by units of norm 1 is Z[epsilon^2] = Z[3+2*sqrt(2)] = Z[2*sqrt(2)], so the index is 2.
For D = A003658(4) = 12, we have O_K = Z[sqrt(3)], and the fundamental unit epsilon = 2+sqrt(3) has norm 1. The order generated by units of norm 1 is Z[epsilon] = Z[sqrt(3)], so the index is 1.
For D = A003658(5) = 13, we have O_K = Z[(1+sqrt(13))/2], and the fundamental unit epsilon = (3+sqrt(13))/2 has norm -1. The order generated by units of norm 1 is Z[epsilon^2] = Z[(11+3*sqrt(13))/2] = Z[(1+3*sqrt(13))/2], so the index is 3.
PROG
(PARI) b(D) = my(w=quadunit(D)); if(norm(w)==-1, imag(w^2), imag(w))
for(D=2, 200, if(isfundamental(D), print1(b(D), ", ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Mar 22 2026
STATUS
approved
