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

A264827 (a,b,c) in lexicographic order such that a^2 + b^2 + a*b - c^2 = 0 with a < b < c and gcd(a, b) = 1.

Original entry on oeis.org

3, 5, 7, 5, 16, 19, 7, 8, 13, 7, 33, 37, 9, 56, 61, 11, 24, 31, 11, 85, 91, 13, 35, 43, 13, 120, 127, 15, 161, 169, 16, 39, 49, 17, 63, 73, 17, 208, 217, 19, 80, 91, 19, 261, 271, 21, 320, 331, 23, 120, 133, 23, 385, 397, 24, 95, 109, 25, 143, 157
Offset: 1

Views

Author

Colin Barker, Nov 26 2015

Keywords

Comments

The sides of a primitive 120-degree integer triangle.

Examples

			Triples (a,b,c) begin:
  3,  5,  7;
  5, 16, 19;
  7,  8, 13;
  7, 33, 37;
  9, 56, 61;
  ...
		

Crossrefs

Programs

  • PARI
    pt120(a) = {
      my(L=List(), n=-3*a^2, f, g, b, c);
      fordiv(n, f,
        g=n\f;
        if(f>g && (g+f)%2==0 && (f-g)%4==0,
          c=(f-g)\4; b=((f+g)\2-a)\2;
          if(b>0 && a
    				

A350038 Numbers that are the perimeter of a primitive 60-degree integer triangle.

Original entry on oeis.org

18, 20, 35, 36, 45, 56, 77, 84, 90, 104, 110, 120, 126, 135, 143, 170, 176, 182, 189, 198, 209, 210, 216, 221, 252, 260, 264, 266, 270, 272, 273, 297, 299, 323, 350, 351, 360, 368, 374, 378, 380, 390, 396, 425, 432, 437, 459, 462, 464, 468, 476, 494, 495, 506, 527, 551, 561, 570, 575, 585, 594, 608, 612
Offset: 1

Author

Seiichi Manyama, Dec 10 2021

Keywords

Examples

			b(n) = Sum_{k=1..3} A264826(3*n+k-3).
c(n) = Sum_{k=1..3} A201223(3*n+k-3).
b(1) = c(1) = 3+7+8 = 18 = a(1).
b(2) = c(2) = 5+7+8 = 20 = a(2).
b(3) = c(5) = 5+19+21 = 45 = a(5).
b(4) = c(3) = 7+13+15 = 35 = a(3).
b(5) = c(9) = 7+37+40 = 84 = a(8).
b(6) = c(4) = 8+13+15 = 36 = a(4).
		

Crossrefs

Programs

  • Ruby
    def A(n)
      ary = []
      (1..n).each{|i|
        (i + 1..n).each{|j|
          if i.gcd(j) == 1 && (i - j) % 3 > 0
            x, y, z = j * j, i * j, i * i
            ary << 2 * x + 5 * y + 2 * z
            ary << 3 * x + 3 * y
          end
        }
      }
      ary
    end
    p A(20).uniq.sort[0..100]

A350013 Number of integer-sided triangles with one side having length n and an adjacent angle of 60 degrees.

Original entry on oeis.org

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

Author

Joseph C. Y. Wong, Dec 08 2021

Keywords

Comments

All terms are greater than or equal to 1 because a triangle with side lengths {n, n, n} is equilateral and has an adjacent angle of 60 degrees.
Number of possible integer solutions to the equation n^2 + x^2 - nx = y^2.
x <= n^2 and y <= n^2. - Seiichi Manyama, Dec 09 2021
From David A. Corneth, Dec 10 2021: (Start)
Solving n^2 + x^2 - nx = y^2 for x using the quadratic formula gives x = (n +- sqrt(4*y^2 - 3*n^2)) / 2.
So we need sqrt(4*y^2 - 3*n^2) to be an integer, say k, i.e., sqrt(4*y^2 - 3*n^2) = k.
Squaring gives 4*y^2 - 3*n^2 = k^2, i.e., (2y - k)*(2y + k) = 4*y^2 - k^2 = 3*n^2
Checking divisors d of 3*n^2 gives all candidates for y = (d + 3*n^2/d)/4 and x = (n +- sqrt(4*y^2 - 3*n^2)) / 2 which must be positive. (End)

Examples

			For n = 8, there are 4 possible integer triangles with side length 8 and adjacent angle 60 degrees. Their side lengths are {8, 3, 7}, {8, 5, 7}, {8, 8, 8}, {8, 15, 13}.
		

Crossrefs

Programs

  • PARI
    a(n) = sum(x=1, n^2, issquare(x^2 - n * x + n^2)); \\ David A. Corneth, Dec 09 2021
    
  • PARI
    a(n) = { my(n23 = 3*n^2, d = divisors(n23), res = 0); for(i = 1, (#d + 1)\2, y = (d[i] + n23/d[i])/4; if(denominator(y) == 1, x = (n + sqrtint(4*y^2 - n23))/2; if(denominator(x) == 1, res++ ); x = (n - sqrtint(4*y^2 - n23))/2; if(x > 0 && denominator(x) == 1, res++ ); ) ); res } \\ faster than above \\ David A. Corneth, Dec 10 2021

Extensions

More terms from David A. Corneth, Dec 09 2021
Showing 1-3 of 3 results.