OFFSET
1,2
COMMENTS
The number of finite sequences of positive integers with even length parity and alternant equal to n.
The number of pairs of integers (h,k) with |k| < sqrt(D), k^2 congruent to D (mod 4), h > (sqrt(D) - k)/2, h exactly dividing (D-k^2)/4, where D=n^2+4.
The number of possible asymmetry types for the quotient sequence of the odd-length continued fraction expansion of a rational number a/b, where b satisfies one of the congruences b^2 + nb - 1 = 0 (mod a) or b^2 - nb - 1 = 0 (mod a)
REFERENCES
D. B. Zagier, Zetafunktionen und quadratische Korper, Springer, 1981.
LINKS
B. R. Smith, Reducing quadratic forms by kneading sequences J. Int. Seq., 17 (2014) 14.11.8.
B. R. Smith, End-symmetric continued fractions and quadratic congruencesActa Arith., 167 (2015) 173-187.
FORMULA
With D=n^2+4, a(n) equals the number of pairs (h,k) with |k| < sqrt(D), k^2 congruent to D (mod 4), h > (sqrt(D) - k)/2, h exactly dividing (D-k^2)/4.
EXAMPLE
For n=4, the a(4) = 5 Zagier-reduced forms of discriminant 20 are x^2 + 6*x*y + 4*y^2, 4*x^2 + 6*x*y + y^2, 4*x^2 + 10*x*y + 5*y^2, 5*x^2 + 10*x*y + 4*y^2, and 2*x^2 + 6*x*y + 2*y^2
MATHEMATICA
Table[Length[
Flatten[
Select[
Table[{a, k}, {k,
Select[Range[Ceiling[-Sqrt[n]], Floor[Sqrt[n]]],
Mod[# - n, 2] == 0 &]}, {a,
Select[Divisors[(n - k^2)/4], # > (Sqrt[n] - k)/2 &]}],
UnsameQ[#, {}] &], 1]], {n, Map[#^2 + 4 &, Range[3, 60]]}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Barry R. Smith, Apr 16 2015
STATUS
approved