login
Number of Zagier-reduced binary quadratic forms of discriminant n^2+4.
2

%I #12 Apr 19 2015 01:00:21

%S 1,2,3,5,5,10,7,13,14,16,12,31,13,24,29,38,17,44,26,47,46,34,30,90,34,

%T 56,49,63,39,106,40,87,77,70,57,139,55,58,89,149,52,138,52,136,123,92,

%U 69,223,84,104,146,111,62,218,94,214,121,132,96,296

%N Number of Zagier-reduced binary quadratic forms of discriminant n^2+4.

%C The number of finite sequences of positive integers with even length parity and alternant equal to n.

%C 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.

%C 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)

%D D. B. Zagier, Zetafunktionen und quadratische Korper, Springer, 1981.

%H B. R. Smith, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL17/Smith/smith5.html">Reducing quadratic forms by kneading sequences</a> J. Int. Seq., 17 (2014) 14.11.8.

%H B. R. Smith, <a href="http://journals.impan.pl/cgi-bin/doi?aa167-2-5">End-symmetric continued fractions and quadratic congruences</a>Acta Arith., 167 (2015) 173-187.

%F 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.

%e 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

%t Table[Length[

%t Flatten[

%t Select[

%t Table[{a, k}, {k,

%t Select[Range[Ceiling[-Sqrt[n]], Floor[Sqrt[n]]],

%t Mod[# - n, 2] == 0 &]}, {a,

%t Select[Divisors[(n - k^2)/4], # > (Sqrt[n] - k)/2 &]}],

%t UnsameQ[#, {}] &], 1]], {n, Map[#^2 + 4 &, Range[3, 60]]}]

%Y Cf. A257003, A257007, A257009

%K nonn

%O 1,2

%A _Barry R. Smith_, Apr 16 2015