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.
%I A256945 #30 Jun 01 2025 10:04:40 %S A256945 1,1,2,1,1,2,2,2,2,1,3,2,1,2,1,2,3,4,2,1,2,2,4,1,2,2,2,3,1,2,2,4,4,2, %T A256945 2,1,2,2,6,1,1,2,4,4,1,4,1,2,3,4,2,2,5,2,4,2,4,1,4,2,4,4,1,2,3,4,1,6, %U A256945 2,2,4,4,2,1,4,2,6,1,2,2,2,4,8,1,1,3,2,4,4,4,2,2,2,4,2,4 %N A256945 Number of periods of reduced indefinite binary quadratic forms with discriminant D(n) = A079896(n). %C A256945 This is an ``imprimitive'' class number. Each a(n) is A087048(n) increased by the number of cycles of discriminant D(n) of imprimitive binary quadratic forms. %C A256945 The gcd of the coefficients is the same for each form within a cycle, so is a cycle invariant. There will exist cycles with gcd invariant equal to k precisely when D(n)/k^2 = A079896(m) for some m. In this case, the number of such cycles is A087048(m). %D A256945 J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, 3rd. ed. See Section 3.3 on page 359. %H A256945 Robin Visser, <a href="/A256945/b256945.txt">Table of n, a(n) for n = 1..10000</a> %F A256945 a(n) is the sum A087048(m) over all integers m with D(m)= D(n)/k^2 for some integer k. %e A256945 a(6) gives the number of cycles of reduced indefinite forms of discriminant D(6) = 20. This is the sum A087048(1) + A087048(6) = 2. %o A256945 (SageMath) %o A256945 def a(n): %o A256945 i, D, S = 1, Integer(5), [] %o A256945 while(i < n): %o A256945 D += 1; i += 1*(((D%4) in [0, 1]) and (not D.is_square())) %o A256945 for b in range(1, isqrt(D)+1): %o A256945 if ((D-b^2)%4 != 0): continue %o A256945 for a in Integer((D-b^2)/4).divisors(): %o A256945 Q = BinaryQF(a, b, -(D-b^2)/(4*a)) %o A256945 if all([(not Q.is_equivalent(t)) for t in S]): S.append(Q) %o A256945 return len(S) # _Robin Visser_, May 31 2025 %Y A256945 Cf. A079896, A087048. %K A256945 nonn %O A256945 1,3 %A A256945 _Barry R. Smith_, Apr 19 2015 %E A256945 Offset corrected and more terms from _Robin Visser_, May 31 2025