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.

A247587 Number of obtuse triangles with integer sides at most n.

Original entry on oeis.org

0, 0, 1, 2, 4, 8, 13, 20, 30, 42, 57, 74, 95, 120, 149, 182, 219, 261, 309, 362, 420, 485, 556, 632, 715, 806, 906, 1012, 1125, 1247, 1377, 1517, 1666, 1824, 1993, 2170, 2358, 2555, 2765, 2986
Offset: 1

Views

Author

Vladimir Letsko, Sep 20 2014

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    tr_o:=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;
  • PARI
    a(n)=sum(a=2,n-1,sum(b=a,n-1,max(0,min(n,a+b-1)-sqrtint(a^2+b^2)))) \\ Charles R Greathouse IV, Sep 20 2014
    
  • PARI
    obtuse(n)=sum(a=2,n-1, max(0, sqrtint(n^2-1-a^2)-max(a,n-a+1)+1))
    s=0; vector(100,n, s+=obtuse(n)) \\ Charles R Greathouse IV, Sep 20 2014