OFFSET
1,4
COMMENTS
When the discriminant of a quadratic equation equals zero, the equation has exactly one real solution (a repeated root).
LINKS
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
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, May 30 2025
STATUS
approved
