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].

Original entry on oeis.org

1, 6, 17, 35, 56, 90, 125, 178, 223, 282, 344, 436, 499, 608, 701, 804, 904, 1062, 1164, 1339, 1450, 1604, 1765, 1988, 2114, 2335, 2525, 2735, 2909, 3194, 3366, 3679, 3887, 4137, 4389, 4661, 4840, 5237, 5536, 5835, 6068, 6507, 6759, 7195, 7473, 7773, 8148, 8645
Offset: 0

Views

Author

DarĂ­o Clavijo, Jun 06 2025

Keywords

Comments

a(n) is lower bounded by n log n for n > 0.
The number of distinct a*c is 2*A027384(n)-1.

Crossrefs

Programs

  • Python
    def a(n):
        D, ac = {0}, {0}
        SQ = [i*i for i in range(0, n+1)]
        for i in range(1, n+1):
            ac.add(i)
            if (s:= SQ[i]) > n:
                ac.add(s)
        for a_ in range(2, n):
            for c in range(a_+ 1, n+1):
                ac.add(a_* c)
        for b in range(n + 1):
            b2 = SQ[b]
            for v in ac:
                ac4 = v << 2
                D.add(b2 + ac4)
                if b2 < ac4:
                    D.add(b2 - ac4)
        return len(D)
    print([a(n) for n in range(0, 48)])