login

Revision History for A364384

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
a(n) is the number of quadratic equations u*x^2 + v*x + w = 0 with different solution sets L != {}, where n = abs(u) + abs(v) + abs(w), the coefficients u, v, w as well as the solutions x_1, x_2 are integers and GCD(u, v, w) = 1.
(history; published version)
#24 by N. J. A. Sloane at Thu Oct 05 14:20:24 EDT 2023
STATUS

proposed

approved

#23 by Chai Wah Wu at Wed Oct 04 15:51:57 EDT 2023
STATUS

editing

proposed

#22 by Chai Wah Wu at Wed Oct 04 15:51:33 EDT 2023
PROG

return c # Chai Wah Wu, Oct 04 2023

#21 by Chai Wah Wu at Wed Oct 04 15:51:18 EDT 2023
PROG

(Python)

from math import gcd

from sympy import integer_nthroot

def A364384(n):

if n == 1: return 1

c = 0

for v in range(0, n):

for w in range(0, n-v):

u = n-v-w

if gcd(u, v, w)==1:

v2, w2, u2 = v*v, w*(u<<2), u<<1

if v2+w2>=0:

d, r = integer_nthroot(v2+w2, 2)

if r and not ((d+v)%u2 or (d-v)%u2):

c += 1

if v>0 and w>0:

c += 1

if v2-w2>=0:

d, r = integer_nthroot(v2-w2, 2)

if r and not((d+v)%u2 or (d-v)%u2):

c += 1

if v>0 and w>0:

c += 1

return c # Chai Wah Wu, Oct 04 2023

STATUS

proposed

editing

#20 by Felix Huber at Wed Oct 04 13:28:16 EDT 2023
STATUS

editing

proposed

#19 by Felix Huber at Wed Oct 04 13:25:39 EDT 2023
MAPLE

nqueqA364384 := proc(n) local i, u, v, w, x_1, x_2, a; a := 0; i := n; for v from 1 - i to i - 1 do for w from abs(v) - i + 1 to i - abs(v) - 1 do u := i - abs(v) - abs(w); if igcd(u, v, w) = 1 then x_1 := 1/2*(-v + sqrt(v^2 - 4*w*u))/u; x_2 := 1/2*(-v - sqrt(v^2 - 4*w*u))/u; if floor(Re(x_1)) = x_1 and floor(Re(x_2)) = x_2 then a := a + 1; end if; end if; end do; end do; end proc; seq(A364384(n), n = 1 .. 100);

local i, u, v, w, x_1, x_2, a_n, L;

L:=[];

for i from 1 to n do

a_n:=0;

for v from 1-i to i-1 do

for w from abs(v)-i+1 to i-abs(v)-1 do

u:=i-abs(v)-abs(w);

if igcd(u, v, w)=1 then

x_1:=(-v+sqrt(v**2-4*u*w))/(2*u);

x_2:=(-v-sqrt(v**2-4*u*w))/(2*u);

if floor(Re(x_1))=x_1 and floor(Re(x_2))=x_2 then

a_n:=a_n+1;

end if;

end if;

end do;

end do;

L:=[op(L), a_n]

end do;

print(L);

end proc:

CROSSREFS

For the situation with n >= abs(u) + abs(v) + abs(w), see A364385.

Cf. A364385 (partial sums), A365876, A365877, A365892

STATUS

approved

editing

Discussion
Wed Oct 04
13:28
Felix Huber: I improved the Maple code and the xrefs.
Thanks!
#18 by N. J. A. Sloane at Tue Aug 08 05:36:08 EDT 2023
STATUS

proposed

approved

#17 by Felix Huber at Mon Aug 07 22:54:26 EDT 2023
STATUS

editing

proposed

#16 by Felix Huber at Mon Aug 07 22:52:42 EDT 2023
MAPLE

local i, u, v, w, x_1, x_2, a_n, L;

L:=[];

for i from 1 to n do

a_n:=0;

for v from 1-i to i-1 do

for w from abs(v)-i+1 to i-abs(v)-1 do

u:=i-abs(v)-abs(w);

if igcd(u, v, w)=1 then

x_1:=(-v+sqrt(v**2-4*u*w))/(2*u);

x_2:=(-v-sqrt(v**2-4*u*w))/(2*u);

if floor(Re(x_1))=x_1 and floor(Re(x_2))=x_2 then

a_n:=a_n+1;

end if;

end if;

end do;

end do;

L:=[op(L), a_n]

end do;

print(L);

STATUS

proposed

editing

Discussion
Mon Aug 07
22:54
Felix Huber: I made the indentations smaller. Thank you for your work.
#15 by Felix Huber at Sun Jul 23 02:22:02 EDT 2023
STATUS

editing

proposed

Discussion
Sun Jul 23
08:08
Jon E. Schoenfield: Thanks!