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.

A384666 Number of distinct values of the quadratic discriminant D=b^2-4*a*c, for a,b,c in the range [-n,n].

This page as a plain text file.
%I A384666 #8 Jun 12 2025 17:05:59
%S A384666 1,6,17,35,56,90,125,178,223,282,344,436,499,608,701,804,904,1062,
%T A384666 1164,1339,1450,1604,1765,1988,2114,2335,2525,2735,2909,3194,3366,
%U A384666 3679,3887,4137,4389,4661,4840,5237,5536,5835,6068,6507,6759,7195,7473,7773,8148,8645
%N A384666 Number of distinct values of the quadratic discriminant D=b^2-4*a*c, for a,b,c in the range [-n,n].
%C A384666 a(n) is lower bounded by n log n for n > 0.
%C A384666 The number of distinct a*c is 2*A027384(n)-1.
%o A384666 (Python)
%o A384666 def a(n):
%o A384666     D, ac = {0}, {0}
%o A384666     SQ = [i*i for i in range(0, n+1)]
%o A384666     for i in range(1, n+1):
%o A384666         ac.add(i)
%o A384666         if (s:= SQ[i]) > n:
%o A384666             ac.add(s)
%o A384666     for a_ in range(2, n):
%o A384666         for c in range(a_+ 1, n+1):
%o A384666             ac.add(a_* c)
%o A384666     for b in range(n + 1):
%o A384666         b2 = SQ[b]
%o A384666         for v in ac:
%o A384666             ac4 = v << 2
%o A384666             D.add(b2 + ac4)
%o A384666             if b2 < ac4:
%o A384666                 D.add(b2 - ac4)
%o A384666     return len(D)
%o A384666 print([a(n) for n in range(0, 48)])
%Y A384666 Cf. A000217, A027384.
%K A384666 nonn
%O A384666 0,2
%A A384666 _DarĂ­o Clavijo_, Jun 06 2025