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.

A299706 Number of Pythagorean triples with perimeter <= 10^n.

Original entry on oeis.org

0, 17, 325, 4858, 64741, 808950, 9706567, 113236940, 1294080089, 14557915466
Offset: 1

Views

Author

Seiichi Manyama, Feb 26 2018

Keywords

Examples

			n = 2
perimeter | Pythagorean triple
-------------------------------
   12     | [ 3,  4,  5]
   30     | [ 5, 12, 13]
   24     | [ 6,  8, 10]
   56     | [ 7, 24, 25]
   40     | [ 8, 15, 17]
   36     | [ 9, 12, 15]
   90     | [ 9, 40, 41]
   60     | [10, 24, 26]
   48     | [12, 16, 20]
   84     | [12, 35, 37]
   60     | [15, 20, 25]
   90     | [15, 36, 39]
   80     | [16, 30, 34]
   72     | [18, 24, 30]
   70     | [20, 21, 29]
   84     | [21, 28, 35]
   96     | [24, 32, 40]
		

Crossrefs

Programs

  • Ruby
    def f(a, b, c, n)
      return 0 if a + b + c > n
      s = n / (a + b + c)
      s += f( a - 2 * b + 2 * c,  2 * a - b + 2 * c,  2 * a - 2 * b + 3 * c, n)
      s += f( a + 2 * b + 2 * c,  2 * a + b + 2 * c,  2 * a + 2 * b + 3 * c, n)
      s += f(-a + 2 * b + 2 * c, -2 * a + b + 2 * c, -2 * a + 2 * b + 3 * c, n)
      return s
    end
    def A299706(n)
      (1..n).map{|i| f(3, 4, 5, 10 ** i)}
    end
    p A299706(8)