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.

A082175 Number of reduced indefinite quadratic forms over the integers in two variables with discriminants D(n)=A079896(n).

This page as a plain text file.
%I A082175 #21 Jun 01 2025 10:04:13
%S A082175 2,2,4,2,6,4,4,4,8,2,6,8,6,8,10,4,6,8,12,2,8,12,8,6,12,8,8,6,18,12,4,
%T A082175 8,16,8,12,14,8,4,16,18,6,8,20,8,14,16,14,12,6,12,16,4,14,20,16,8,20,
%U A082175 14,8,8,28,20,10,4,22,16,10,20,20,16,12,8,20,2,20,24,20,10,24,16,8,12
%N A082175 Number of reduced indefinite quadratic forms over the integers in two variables with discriminants D(n)=A079896(n).
%C A082175 An indefinite quadratic form in two variables over the integers, a*x^2 + b*x*y + c*y^2 with discriminant D = b^2 - 4*a*c > 0, 0 or 1 (mod 4) and not a square, is called reduced if b>0 and f(D) - min(|2*a|,|2*c|) <= b < f(D), with f(D) := ceiling(sqrt(D)). See the Scholz-Schoeneberg reference for this definitions.
%D A082175 A. Scholz and B. Schoeneberg, Einführung in die Zahlentheorie, 5. Aufl., de Gruyter, Berlin, New York, 1973, ch.IV, par.31, p. 112.
%H A082175 Robin Visser, <a href="/A082175/b082175.txt">Table of n, a(n) for n = 1..10000</a>
%H A082175 Henri Cohen, <a href="https://doi.org/10.1007/978-3-662-02945-9">A Course in Computational Algebraic Number Theory</a>, Grad. Texts in Math., Vol. 138, Springer-Verlag, Berlin, 1993. xii+534 pp.  See Definition 5.6.2 on page 257.
%F A082175 a(n)= number of reduced indefinite quadratic forms over the integers for D(n)=A079896(n) (counting also nonprimitive forms).
%e A082175 a(1)=2 because there are two reduced forms for D(1)=A079896(1)=5, namely [a,b,c]=[-1, 1, 1] and [1, 1, -1]; here f(5)=3.
%e A082175 a(5)=6: for D(5)=A079896(5)=17 (f(17)=5) the 6 reduced [a,b,c] forms are [[-2, 1, 2], [2, 1, -2], [-2, 3, 1], [-1, 3, 2], [1, 3, -2], [2, 3, -1]]. They are all primitive (that is a,b and c are relatively prime).
%e A082175 a(6)=4: for D(6)=A079896(6)=20 (f(20)=5) there are four reduced forms: [-2, 2, 2], [2, 2, -2], [-1, 4, 1] and [1, 4, -1], Here two of them are nonprimitive, namely [-2, 2, 2], [2, 2, -2].
%e A082175 a(11)=6, D(11)=A079896(11)=32 (f(32)=6); the 6 reduced forms are [-4, 4, 1], [-2, 4, 2], [-1, 4, 4], [1, 4, -4], [2, 4, -2] and [4, 4, -1]. Two of them are nonprimitive, namely [ -2, 4, 2] and [2, 4, -2]. Therefore A082174(11)=4.
%o A082175 (SageMath)
%o A082175 def a(n):
%o A082175     i, D, ans = 1, Integer(5), 0
%o A082175     while(i < n):
%o A082175         D += 1; i += 1*(((D%4) in [0,1]) and (not D.is_square()))
%o A082175     for b in range(1, isqrt(D)+1):
%o A082175         if ((D-b^2)%4 != 0): continue
%o A082175         for a in Integer((D-b^2)/4).divisors():
%o A082175             if abs(sqrt(D) - 2*a) < b: ans += 1
%o A082175     return 2*ans  # _Robin Visser_, May 31 2025
%Y A082175 Cf. A082174 (number of primitive reduced forms).
%K A082175 nonn,easy
%O A082175 1,1
%A A082175 _Wolfdieter Lang_, Apr 11 2003
%E A082175 Offset corrected and more terms from _Robin Visser_, May 31 2025