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.

Showing 1-4 of 4 results.

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

Original entry on oeis.org

1, 3, 2, 6, 3, 6, 2, 8, 4, 7, 4, 8, 2, 10, 4, 8, 5, 10, 2, 10, 4, 10, 4, 10, 4, 11, 6, 8, 4, 12, 2, 14, 4, 8, 6, 12, 5, 12, 4, 10, 4, 14, 2, 14, 6, 8, 6, 12, 4, 15, 6, 10, 4, 12, 4, 14, 6, 12, 4, 14, 2, 14, 6, 10, 9, 14, 4, 12, 4, 12, 4, 18, 2, 16, 6, 8, 8, 12, 4, 16, 6, 13, 6, 14, 4, 14, 6, 10, 4, 18, 4, 18, 6, 8, 6, 14, 4, 16, 6, 14
Offset: 1

Views

Author

Felix Huber, Jul 22 2023

Keywords

Examples

			For n = 4 the a(4) = 6 solutions (u, v, w, x_1, x_2) with positive u are (1, -3, 0, 3, 0), (1, -2, 1, 1, 1), (1, -1, -2, 2, -1), (1, 1, -2, 1, -2), (1, 2, 1, -1, -1), (1, 3, 0, 0, -3).
Equations multiplied by -1 do not have a different solution set; for example, (-1, 3, 0, 3, 0) has the same solution set as (1, -3, 0, 3, 0).
Equations with GCD(u, v, w) != 1 are not considered, they belong to a lower n. For example (2, 2, 0, 0, -1) ist not considered here, it belongs to n = 2 with (1, 1, 0, 0, -1).
		

Crossrefs

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

Programs

  • Maple
    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; seq(A364384(n), n = 1 .. 100);
  • 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

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.

Original entry on oeis.org

1, 4, 6, 12, 15, 21, 23, 31, 35, 42, 46, 54, 56, 66, 70, 78, 83, 93, 95, 105, 109, 119, 123, 133, 137, 148, 154, 162, 166, 178, 180, 194, 198, 206, 212, 224, 229, 241, 245, 255, 259, 273, 275, 289, 295, 303, 309, 321, 325, 340, 346, 356, 360, 372, 376, 390, 396
Offset: 1

Views

Author

Felix Huber, Jul 22 2023

Keywords

Examples

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

Crossrefs

Partial sums of A364384.

Programs

  • Maple
    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;
    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);
  • Python
    from math import gcd
    from sympy import integer_nthroot
    def A364385(n):
        c = 0
        for v in range(0,n):
            for w in range(0,n-v):
                for u in range(1,n-v-w+1):
                    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 v>0 and v2-w2>=0:
                            d, r = integer_nthroot(v2-w2,2)
                            if r and not((d+v)%u2 or (d-v)%u2):
                                c += 1
                                if w>0:
                                    c += 1
        return c # Chai Wah Wu, Oct 04 2023

Formula

a(n) = Sum_{k=1..n} A364384(k).

A365876 a(n) is the number of quadratic equations u*x^2 + v*x + w = 0 with distinct solution sets L != {}, integer coefficients u, v, w and GCD(u, v, w) = 1, where n = abs(u) + abs(v) + abs(w) and the sum of the solutions equals the product of the solutions.

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 3, 2, 4, 2, 6, 2, 7, 3, 5, 4, 9, 3, 10, 5, 7, 5, 12, 5, 11, 6, 10, 7, 16, 4, 17, 9, 11, 8, 14, 7, 20, 10, 13, 9, 22, 7, 23, 11, 13, 12, 26, 9, 24, 11, 18, 13, 29, 10, 22, 14, 20, 15, 32, 9, 33, 16, 20, 18, 27, 11, 37, 18, 25, 13, 39, 13, 40, 20
Offset: 1

Views

Author

Felix Huber, Sep 22 2023

Keywords

Comments

According to Vieta's formulas, x_1 + x_2 = -v/u and x_1*x_2 = w/u. So x_1 + x_2 = x_1*x_2 when v = -w. Furthermore, the discriminant must not be negative, i.e., v^2 - 4*u*w = v^2 + 4*u*v >= 0.

Examples

			For n = 9 the a(9) = 4 equations are given by (u, v, w) = (7, 1, -1), (5, 2, -2), (1, 4, -4), (-1, 4, -4).
Equations multiplied by -1 do not have a different solution set; for example,  (-7, -1, 1) has the same solution set as (7, 1, -1).
Equations with GCD(u, v, w) != 1 are excluded, because their solution sets are assigned to equations with lower n. For example, (3, 3, -3) is not included here, because its solution set is already assigned to (1, 1, -1).
Equations with a double solution are considered to have two equal solutions. For example, (-1, 4, -4) has the two solutions x_1 = x_2 = 2.
		

Crossrefs

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

Programs

  • Maple
    A365876:= proc(n) local u, v, a, min; u := n; v := 0; a := 0; min := true; while min = true do if u <> 0 and gcd(u, v) = 1 then a := a + 1; end if; u := u - 2; v:=(n-abs(u))/2; if u < -1/9*n then min := false; end if; end do; return a; end proc; seq(A365876(n), n = 1 .. 74);
  • Python
    from math import gcd
    def A365876(n):
        if n == 1: return 1
        c = 0
        for v in range(1,n+1>>1):
            u = n-(v<<1)
            if gcd(u,v)==1:
                v2, u2 = v*v, v*(u<<2)
                if v2+u2 >= 0:
                    c +=1
                if v2-u2 >= 0:
                    c +=1
        return c # Chai Wah Wu, Oct 04 2023

A365877 a(n) is the number of quadratic equations u*x^2 + v*x + w = 0 with distinct solution sets L != {} and integer coefficients u, v, w, where n >= abs(u) + abs(v) + abs(w) and the sum of the solutions equals the product of the solutions.

Original entry on oeis.org

1, 1, 2, 3, 5, 6, 9, 11, 15, 17, 23, 25, 32, 35, 40, 44, 53, 56, 66, 71, 78, 83, 95, 100, 111, 117, 127, 134, 150, 154, 171, 180, 191, 199, 213, 220, 240, 250, 263, 272, 294, 301, 324, 335, 348, 360, 386, 395, 419, 430, 448, 461, 490, 500, 522, 536, 556, 571, 603
Offset: 1

Views

Author

Felix Huber, Sep 22 2023

Keywords

Comments

According to Vieta's formulas, x_1 + x_2 = -v/u and x_1*x_2 = w/u. So x_1 + x_2 = x_1*x_2 when v = -w. Furthermore, the discriminant must not be negative, i.e., v^2 - 4*u*w = v^2 + 4*u*v >= 0.

Examples

			For n = 11 the a(11) = 23 equations are given by (u, v, w) = (1, 0, 0), (1, 1, -1), (2, 1, -1), (1, 2, -2), (3, 1, -1), (4, 1, -1), (5, 1, -1), (3, 2, -2), (1, 3, -3), (6, 1, -1), (2, 3, -3), (7, 1, -1), (5, 2, -2), (1, 4, -4), (-1, 4, -4), (8, 1, -1), (4, 3, -3), (9, 1, -1), (7, 2, -2), (5, 3, -3), (3, 4, -4), (1, 5, -5), (-1, 5, -5).
Equations multiplied by -1 do not have a different solution set; for example, (- 1, -1, 1) has the same solution set as (1, 1, -1).
Equations with GCD(u, v, w) != 1 are excluded, because their solution set are assigned to equations with lower n. For example, (2, 0, 0) is not included here, because its solution set is already assigned to (1, 0, 0).
Equations with a double solution are considered to have two equal solutions. For example, (-1, 4, -4) has the two solutions x_1 = x_2 = 2.
		

Crossrefs

Partial sums of A365876.

Programs

  • Maple
    A365876:= proc(n) local u, v, a, min; u := n; v := 0; a := 0; min := true; while min = true do if u <> 0 and gcd(u, v) = 1 then a := a + 1; end if; u := u - 2; v:=(n-abs(u))/2; if u < -1/9*n then min := false; end if; end do; return a; end proc;
    A365877:= proc(n) local s; option remember; if n = 1 then A365876(1); else procname(n - 1) + A365876(n); end if; end proc; seq(A365877(n), n = 1 .. 59);
  • Python
    from math import gcd
    def A365877(n):
        if n == 1: return 1
        c = 1
        for m in range(2,n+1):
            for v in range(1,m+1>>1):
                u = m-(v<<1)
                if gcd(u,v)==1:
                    v2, u2 = v*v, v*(u<<2)
                    if v2+u2 >= 0:
                        c +=1
                    if v2-u2 >= 0:
                        c +=1
        return c # Chai Wah Wu, Oct 05 2023

Formula

a(n) = Sum_{k=1..n} A365876(k).
a(n) = A341123(n) for 1 <= n <= 13.
Showing 1-4 of 4 results.