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.

A364385 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) and the coefficients u, v, w as well as the solutions x_1, x_2 are integers.

This page as a plain text file.
%I A364385 #31 Dec 29 2024 15:02:53
%S A364385 1,4,6,12,15,21,23,31,35,42,46,54,56,66,70,78,83,93,95,105,109,119,
%T A364385 123,133,137,148,154,162,166,178,180,194,198,206,212,224,229,241,245,
%U A364385 255,259,273,275,289,295,303,309,321,325,340,346,356,360,372,376,390,396
%N A364385 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) and the coefficients u, v, w as well as the solutions x_1, x_2 are integers.
%H A364385 Felix Huber, <a href="/A364385/a364385.txt">Equations for a given n</a>.
%H A364385 Wikipedia, <a href="https://en.wikipedia.org/wiki/Quadratic_equation">Quadratic equation</a>.
%F A364385 a(n) = Sum_{k=1..n} A364384(k).
%e A364385 For n = 3 the a(3) = 6 solutions (u, v, w, x_1, x_2) with positive u are (1, 0, 0, 0, 0), (1, -1, 0, 1, 0), (1, 0, -1, 1, -1), (1, 1, 0, 0, -1), (1, -2, 0, 2, 0), (1, 2, 0, 0, -2).
%e A364385 Equations multiplied by -1 do not have a different solution set, for example (-1, 1, 0, 1, 0) has the same solution set as (1, -1, 0, 1, 0).
%p A364385 A364384 := 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;
%p A364385 A364385 := proc(n) local s; option remember; if n = 1 then A364384(1); else procname(n - 1) + A364384(n); end if; end proc; seq(A364385(n), n = 1 .. 57);
%o A364385 (Python)
%o A364385 from math import gcd
%o A364385 from sympy import integer_nthroot
%o A364385 def A364385(n):
%o A364385     c = 0
%o A364385     for v in range(0,n):
%o A364385         for w in range(0,n-v):
%o A364385             for u in range(1,n-v-w+1):
%o A364385                 if gcd(u,v,w)==1:
%o A364385                     v2, w2, u2 = v*v, w*(u<<2), u<<1
%o A364385                     if v2+w2>=0:
%o A364385                         d, r = integer_nthroot(v2+w2,2)
%o A364385                         if r and not ((d+v)%u2 or (d-v)%u2):
%o A364385                             c += 1
%o A364385                             if v>0 and w>0:
%o A364385                                 c += 1
%o A364385                     if v>0 and v2-w2>=0:
%o A364385                         d, r = integer_nthroot(v2-w2,2)
%o A364385                         if r and not((d+v)%u2 or (d-v)%u2):
%o A364385                             c += 1
%o A364385                             if w>0:
%o A364385                                 c += 1
%o A364385     return c # _Chai Wah Wu_, Oct 04 2023
%Y A364385 Partial sums of A364384.
%Y A364385 Cf. A365876, A365877, A365892
%K A364385 easy,nonn
%O A364385 1,2
%A A364385 _Felix Huber_, Jul 22 2023