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-7 of 7 results.

A365892 a(n) is the index of the n-th term of A365876 that includes at least one equation with at least one integer solution.

Original entry on oeis.org

1, 4, 9, 11, 20, 22, 35, 37, 54, 56, 77, 79, 104, 106, 135, 137, 170, 172, 209, 211, 252, 254, 299, 301, 350, 352, 405, 407, 464, 466, 527, 529, 594, 596, 665, 667, 740, 742, 819, 821, 902, 904, 989, 991, 1080, 1082, 1175, 1177, 1274, 1276, 1377, 1379, 1484, 1486
Offset: 1

Views

Author

Felix Huber, Sep 22 2023

Keywords

Comments

Observation (checked up to a(52)): a(n) = A266257(n) for n >= 2.
Conjectures in formula section hold for 2<=n<=300. - Chai Wah Wu, Oct 05 2023

Examples

			a(1) = 1 since the equation x^2 = 0 belonging to A365876(1) has the integer solution 0. 1 is the 1st term that includes at least one equation with at least one integer solution.
a(2) = 4 since the equation 2*x^2 + x - 1 = 0 belonging to A365876(4) has the integer solution -1. 4 is the 2nd term that includes at least one equation with at least one integer solution.
a(3) = 9 since the equation -x^2 + 4*x - 1 = 0 belonging to A365876(9) has the integer solution 2. 9 is the 3rd term that includes at least one equation with at least one integer solution.
a(4) = 11 since the equation 3*x^2 + 4*x - 4 = 0 belonging to A365876(11) has the integer solution -2. 11 is the 4th term that includes at least one equation with at least one integer solution.
		

Crossrefs

Programs

  • Maple
    A365892 := proc(n_A365876) local u, v, a, min, x_1, x_2; u := n_A365876; v := 0; a := false; min := true; while min = true do if u <> 0 and gcd(u, v) = 1 then x_1 := 1/2*(-v + sqrt(v^2 + 4*v*u))/u; x_2 := 1/2*(-v - sqrt(v^2 + 4*v*u))/u; if x_1 = floor(x_1) or x_2 = floor(x_2) then a := true; end if; end if; u := u - 2; v := 1/2*n_A365876 - 1/2*abs(u); if u < -1/9*n_A365876 then min := false; end if; end do; if a = true then return n_A365876; end if; end proc; seq(A365892(n_A365876), n_A365876 = 1 .. 1486);
  • Python
    from math import gcd
    from itertools import count, islice
    from sympy import integer_nthroot
    def A365892_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            if n == 1:
                yield 1
            else:
                for v in range(1,n+1>>1):
                    u = n-(v<<1)
                    if gcd(u,v)==1:
                        v2, u2, a = v*v, v*(u<<2), u<<1
                        if v2+u2 >= 0:
                            d,r = integer_nthroot(v2+u2,2)
                            if r and not ((d+v)%a and (d-v)%a):
                                yield n
                                break
                        if v2-u2 >= 0:
                            d,r = integer_nthroot(v2-u2,2)
                            if r and not ((d+v)%a and (d-v)%a):
                                yield n
                                break
    A365892_list = list(islice(A365892_gen(),20)) # Chai Wah Wu, Oct 04 2023

Formula

Conjectures (see also A266257): (Start)
a(1) = 1, a(n) = ((n + 1)^2 - (-1)^n*(n - 1))/2 for n >= 2.
a(1) = 1, a(2) = 4, a(3) = 9, a(4) = 11, a(5) = 20, a(6) = 22, a(n) = a(n - 1) + 2*a(n - 2) - 2*a(n - 3) - a(n - 4) + a(n - 5) for n >= 7.
G.f.: (1 + x + 3*x^3 - x^4)/((1 - x)^3*(1 + x)^2). (End)

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

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.

A379597 a(n) is the number of distinct solution sets to the quadratic equations u*x^2 + v*x + w = 0 with integer coefficients u, v, w, abs(u) + abs(v) + abs(w) <= n having a nonnegative discriminant.

Original entry on oeis.org

1, 4, 12, 24, 50, 80, 134, 192, 276, 366, 510, 632, 834, 1018, 1262, 1502, 1858, 2136, 2584, 2956, 3448, 3910, 4576, 5076, 5834, 6488, 7320, 8066, 9136, 9892, 11118, 12114, 13358, 14482, 15978, 17108, 18862, 20272, 22024, 23532, 25700, 27216, 29600, 31486, 33746
Offset: 1

Views

Author

Felix Huber, Feb 18 2025

Keywords

Comments

Quadratic equations u*x^2 + v*x + w = 0 with real coefficients u, v, w and nonnegative discriminant v^2 - 4*u*w have two real solutions.
a(n) is even for n >= 2.

Examples

			a(3) = 12 because there are 12 equations with abs(u) + abs(v) + abs(w) <= 3 and distinct solution set having a nonnegative discriminant: (u, v, w) = (1, 0, 0), (1, -1, 0), (1, 1, 0), (1, 0, -1), (1, -1, -1), (1, 1, -1), (1, -2, 0), (1, 2, 0), (1, 0, -2), (2, -1, 0), (2, 1, 0), and (2, 0, -1). Multiplied equations like 2*(1, 0, 0) = (2, 0, 0) or (-1)*(1, -1, 0) = (-1, 1, 0) do not have a distinct solution set.
		

Crossrefs

Programs

  • Maple
    A379597:=proc(n)
       option remember;
       local a,u,v,w;
       if n=1 then
          1
       else
          a:=0;	
          for u to n-1 do
             for v from 0 to n-u do
                w:=n-u-v;
                if igcd(u,v,w)=1 then
                   if v=0 then
                      a:=a+1
                   elif w=0 or w>=v^2/(4*u) then
                      a:=a+2
                   else
                      a:=a+4
                   fi
                fi
             od
          od;
          a+procname(n-1)
       fi;
    end proc;
    seq(A379597(n),n=1..45);

A381710 a(n) is the number of distinct solution sets to the quadratic equations u*x^2 + v*x + w = 0 with integer coefficients u, v, w, abs(u) + abs(v) + abs(w) <= n having a negative discriminant.

Original entry on oeis.org

0, 1, 5, 11, 25, 39, 69, 99, 143, 189, 265, 327, 437, 529, 653, 777, 965, 1107, 1343, 1531, 1783, 2021, 2367, 2619, 3013, 3343, 3771, 4153, 4707, 5087, 5721, 6229, 6865, 7437, 8197, 8767, 9677, 10391, 11279, 12043, 13155, 13919, 15147, 16101, 17249, 18301, 19763
Offset: 1

Views

Author

Felix Huber, Mar 06 2025

Keywords

Comments

Quadratic equations u*x^2 + v*x + w = 0 with real coefficients u, v, w and negative discriminant v^2 - 4*u*w have two complex solutions.
a(n) is odd for n >= 2.

Examples

			a(3) = 5 because there are 5 equations with abs(u) + abs(v) + abs(w) <= 3 and distinct solution set having a negative discriminant: (u, v, w) = (1, 0, 1), (1, -1, 1), (1, 1, 1), (1, 0, 2), (2, 0, 1). Multiplied equations like (-1)*(1, -1, 1) = (-1, 1, -1) do not have a distinct solution set.
		

Crossrefs

Programs

  • Maple
    A381710:=proc(n)
       option remember;
       local a,u,v,w;
          if n=1 then
          0
       else
          a:=0;
          for u to n-1 do
             for v from 0 to n-u do
                w:=n-u-v;
                   if igcd(u,v,w)=1 then
                      if v=0 then
                         a:=a+1
                      elif w>v^2/(4*u) then
                        a:=a+2
                   fi
                fi
             od
          od;
          a+procname(n-1)
       fi;
    end proc;
    seq(A381710(n),n=1..47);

A381711 a(n) = A379597(n) - A381710(n).

Original entry on oeis.org

1, 3, 7, 13, 25, 41, 65, 93, 133, 177, 245, 305, 397, 489, 609, 725, 893, 1029, 1241, 1425, 1665, 1889, 2209, 2457, 2821, 3145, 3549, 3913, 4429, 4805, 5397, 5885, 6493, 7045, 7781, 8341, 9185, 9881, 10745, 11489, 12545, 13297, 14453, 15385, 16497, 17517, 18917
Offset: 1

Views

Author

Felix Huber, Mar 08 2025

Keywords

Comments

a(n) is odd.

Crossrefs

Programs

  • Maple
    A381711:=proc(n)
       option remember;
       local a,u,v,w;
       if n=1 then
          1
       else
          a:=0;
          for u to n-1 do
             for v from 0 to n-u do
                w:=n-u-v;
                if igcd(u,v,w)=1 and v<>0 then
                   if w=0 or w=v^2/(4*u) then
                      a:=a+2
                   elif wA381711(n),n=1..47);

Formula

a(n) = A379597(n) - A381710(n).
Showing 1-7 of 7 results.