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.

A247588 Number of integer-sided acute triangles with largest side n.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 11, 13, 15, 17, 21, 25, 27, 31, 34, 39, 43, 48, 52, 56, 63, 67, 73, 80, 84, 90, 96, 104, 111, 117, 126, 132, 140, 147, 154, 165, 172, 183, 189, 198, 210, 219, 229, 237, 247, 260, 270, 282, 292, 302
Offset: 1

Views

Author

Vladimir Letsko, Sep 20 2014

Keywords

Examples

			a(3) = 3 because there are 3 integer-sided acute triangles with largest side 3: (1,3,3); (2,3,3); (3,3,3).
		

Crossrefs

Programs

  • Maple
    tr_a:=proc(n) local a,b,t,d;t:=0:
    for a to n do
    for b from max(a,n+1-a) to n do
    d:=a^2+b^2-n^2:
    if d>0 then t:=t+1 fi
    od od;
    t; end;
  • Mathematica
    a[ n_] := Length @ FindInstance[ n >= b >= a >= 1 && n < b + a && n^2 < b^2 + a^2, {a, b}, Integers, 10^9]; (* Michael Somos, May 24 2015 *)
  • PARI
    a(n) = sum(j=0, n*(1 - sqrt(2)/2), n - j - floor(sqrt(2*j*n - j^2))); \\ Michel Marcus, Oct 07 2014
    
  • PARI
    {a(n) = sum(j=0, n - sqrtint(n*n\2) - 1, n - j - sqrtint(2*j*n - j*j))}; /* Michael Somos, May 24 2015 */

Formula

a(n) = Sum_{j=0..floor(n*(1 - sqrt(2)/2))} (n - j - floor(sqrt(2*j*n - j^2))). - Anton Nikonov, Oct 06 2014
a(n) = (1/8)*(-4*ceiling((n - 1)/sqrt(2)) + 4*n^2 - A000328(n) + 1), n > 1. - Mats Granvik, May 23 2015

A247586 Number of acute triangles with integer sides less than or equal to n.

Original entry on oeis.org

1, 3, 6, 11, 17, 25, 36, 49, 64, 81, 102, 127, 154, 185, 219, 258, 301, 349, 401, 457, 520, 587, 660, 740, 824, 914, 1010, 1114, 1225, 1342, 1468, 1600, 1740, 1887, 2041, 2206, 2378, 2561, 2750, 2948
Offset: 1

Views

Author

Vladimir Letsko, Sep 20 2014

Keywords

Examples

			a(2) = 3 because there are 3 acute triangles with integer sides less than or equal to 2: (1,1,1); (1,2,2); (2,2,2).
		

Crossrefs

Programs

  • Maple
    tr_a:=proc(n) local a,b,c,t,d;t:=0:
      for a to n do
      for b from a to n do
      for c from b to min(a+b-1,n) do
      d:=a^2+b^2-c^2:
      if d>0 then t:=t+1 fi
      od od od;
      [n,t]; end;
  • Mathematica
    a[n_] := Module[{a, b, c, d, t = 0}, Do[d = a^2 + b^2 - c^2; If[d>0, t++], {a, n}, {b, a, n}, {c, b, Min[a+b-1, n]}]; t]; Array[a, 40] (* Jean-François Alcover, Jun 19 2019, from Maple *)
  • Python
    import itertools
    def A247586(n):
        I = itertools.combinations_with_replacement(range(1,n+1),3)
        F = filter(lambda c: c[0]**2 + c[1]**2 > c[2]**2, I)
        return len(list(F))
    print([A247586(n) for n in range(41)]) # Peter Luschny, Sep 22 2014

A306674 Number of distinct non-similar obtuse triangles with integer sides and length of largest side <= n.

Original entry on oeis.org

0, 0, 1, 2, 5, 9, 14, 21, 31, 44, 59, 76, 98, 123, 153, 186, 224, 266, 314, 368, 426, 491, 562, 638, 723, 815, 915, 1021, 1135, 1258, 1388, 1528, 1677, 1836, 2006, 2183, 2372, 2569, 2780, 3002, 3233, 3476, 3731, 4000, 4282, 4574, 4880, 5198, 5531, 5879
Offset: 1

Views

Author

César Eliud Lozada, Mar 04 2019

Keywords

Examples

			For n=6, there are 9 integer-sided obtuse triangles with largest side <= n. These have sides {a, b, c} = {2, 2, 3}, {2, 3, 4}, {2, 4, 5}, {2, 5, 6}, {3, 3, 5}, {3, 4, 5}, {3, 4, 6}, {3, 5, 6}, {4, 4, 6}. But {4, 4, 6} is similar to {2, 2, 3} and is excluded from the list, so a(6) = 8.
		

Crossrefs

Programs

  • Maple
    #nType=1 for acute triangles, nType=2 for obtuse triangles, nType=0 for both triangles
    CountTriangles := proc (n, nType := 1)
      local aa, oo, a, b, c, tt, lAcute;
      aa := {}; oo := {};
      for a from n by -1 to 1 do for b from a by -1 to 1 do for c from b by -1 to 1 do
        if a < b+c and abs(b-c) < a and b < c+a and abs(c-a) < b and c < a+b and abs(a-b) < c and gcd(a, gcd(b, c)) = 1 then
          lAcute := evalb(0 < b^2+c^2-a^2);
          tt := sort([a, b, c]);
          if lAcute then aa := {op(aa), tt} else oo := {op(oo), tt} end if
        end if
      end do end do end do;
      return sort(`if`(nType = 1, aa, `if`(nType=2,oo,`union`(aa,oo))))
    end proc

A247589 Number of integer-sided obtuse triangles with largest side n.

Original entry on oeis.org

0, 0, 1, 1, 2, 4, 5, 7, 10, 12, 15, 17, 21, 25, 29, 33, 37, 42, 48, 53, 58, 65, 71, 76, 83, 91, 100, 106, 113, 122, 130, 140, 149, 158, 169, 177, 188, 197, 210, 221, 230, 243, 255, 269, 281, 292, 306, 318, 333, 346
Offset: 1

Views

Author

Vladimir Letsko, Sep 20 2014

Keywords

Examples

			a(5) = 2 because there are 2 integer-sided acute triangles with largest side 5: (2,4,5); (3,3,5).
		

Crossrefs

Programs

  • Maple
    tr_o:=proc(n) local a,b,t,d;t:=0:
    for a to n do
    for b from max(a,n+1-a) to n do
    d:=a^2+b^2-n^2:
    if d<0 then t:=t+1 fi
    od od;
    t; end;

Formula

a(n) = k*(k + (1+(-1)^n)/2) + Sum_{j=1..floor(n*(1-sqrt(2)/2))} floor(sqrt(2*j*n - j^2 - 1) - j), where k = floor((2*n*(sqrt(2) - 1) + 1 - (-1)^n)/4) (it appears that k(n) is A070098(n)). - Anton Nikonov, Sep 29 2014
Showing 1-4 of 4 results.