login
A384469
a(n) is the number of triples 1 <= A, B, C <= n such that the discriminant D = B^2 - 4*A*C of the polynomial A*x^2 + B*x + C is 0.
1
0, 1, 1, 4, 4, 5, 5, 8, 10, 11, 11, 16, 16, 17, 17, 22, 22, 25, 25, 28, 28, 29, 29, 36, 40, 41, 43, 46, 46, 49, 49, 54, 54, 55, 55, 64, 64, 65, 65, 70, 70, 71, 71, 74, 76, 77, 77, 86, 92, 97, 97, 100, 100, 103, 103, 108, 108, 109, 109, 118, 118, 119, 121, 130
OFFSET
1,4
COMMENTS
When the discriminant of a quadratic equation equals zero, the equation has exactly one real solution (a repeated root).
EXAMPLE
For n = 2, for 1 <= A, B, C <= 2, a(2) is the number of discriminants D = B^2 - 4*A*C, where D = 0.
D_1 = 1^2 - 4*1*1 = -3 (x^2 + x + 1),
D_2 = 1^2 - 4*1*2 = -7 (x^2 + x + 2),
D_3 = 1^2 - 4*2*1 = -7 (2*x^2 + x + 1),
D_4 = 1^2 - 4*2*2 = -7 (2*x^2 + x + 2),
D_5 = 2^2 - 4*1*1 = 0 (x^2 + 2*x + 1),
D_6 = 2^2 - 4*1*2 = -4 (x^2 + 2*x + 2),
D_7 = 2^2 - 4*2*1 = -4 (2*x^2 + 2*x + 1),
D_8 = 2^2 - 4*2*2 = -4 (2*x^2 + 2*x + 2).
One discriminant D_5 = 0 (of the quadratic equation x^2 + 2*x + 1) , thus a(2) = 1.
MATHEMATICA
a[n_] := Sum[Boole[b^2 - 4*a*c == 0], {a, 1, n}, {b, 1, n}, {c, 1, n}]; Array[a, 64] (* Amiram Eldar, Jun 02 2025 *)
PROG
(PARI) a(n) = sum(x=1, n, sum(y=1, n, sum(z=1, n, x^2-4*y*z==0))); \\ Michel Marcus, Jun 13 2025
(Python)
from math import isqrt
from sympy.ntheory.primetest import is_square
def A384469(n): return (sum(1 for a in range(1, n+1) for c in range(1, a) if ((m:=a*c)<<2)<=n**2 and is_square(m))<<1)+isqrt(n**2>>2) # Chai Wah Wu, Jun 13 2025
CROSSREFS
Cf. A384666.
Sequence in context: A120205 A257291 A152465 * A357414 A082968 A136013
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, May 30 2025
STATUS
approved