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.

A070201 Number of integer triangles with perimeter n having integral inradius.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 3, 0, 0, 0, 2, 0, 1, 0, 1, 0, 2, 0, 2, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 8, 0, 0, 0, 1, 0, 3
Offset: 1

Views

Author

Reinhard Zumkeller, May 05 2002

Keywords

Comments

a(n) = #{k | A070083(k) = n and A070200(k) = exact inradius};
a(n) = A070203(n) + A070204(n);
a(n) = A070205(n) + A070206(n) + A024155(n);
a(odd) = 0.

Examples

			a(36)=2, as there are two integer triangles with integer inradius having perimeter=32:
First: [A070080(368), A070081(368), A070082(368)] = [9,10,17], for s = A070083(368)/2 = (9+10+17)/2 = 18: inradius = sqrt((s-9)*(s-10)*(s-17)/s) = sqrt(9*8*1/18) = sqrt(4) = 2; therefore A070200(368) = 2.
2nd: [A070080(370), A070081(370), A070082(370)] = [9,12,15], for s = A070083(370)/2 = (9+12+15)/2 = 18: inradius = sqrt((s-9)*(s-12)*(s-15)/s) = sqrt(9*6*3/18) = sqrt(9) = 3; therefore A070200(370) = 3.
		

Crossrefs

Programs

  • Ruby
    def A(n)
      cnt = 0
      (1..n / 3).each{|a|
        (a..(n - a) / 2).each{|b|
          c = n - a - b
          if a + b > c
            s = n / 2r
            t = (s - a) * (s - b) * (s - c) / s
            if t.denominator == 1
              t = t.to_i
              cnt += 1 if Math.sqrt(t).to_i ** 2 == t
            end
          end
        }
      }
      cnt
    end
    def A070201(n)
      (1..n).map{|i| A(i)}
    end
    p A070201(100) # Seiichi Manyama, Oct 06 2017