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.

A332689 Number of distinct areas of integer-sided triangles whose area equals n times their perimeter.

Original entry on oeis.org

5, 17, 41, 41, 47, 127, 77, 81, 171, 132, 99, 283, 94, 205, 349, 158, 115, 457, 122, 296, 530, 267, 134, 546, 219, 260, 428, 471, 130, 953, 144, 264, 613, 332, 557, 1031, 139, 346, 614, 600, 162, 1381, 169, 562, 1132, 348, 186, 1000, 363, 593, 688, 571, 164, 1123
Offset: 1

Views

Author

Jeppe Stig Nielsen, Feb 19 2020

Keywords

Comments

Gives the row lengths of the irregular array A290451.

Examples

			For n = 2, there are 18 different (noncongruent) Heronian triangles whose area equals twice their perimeter, so A007237(2) = 18. However, two of those 18 triangles share the area 168. So there are only 17 distinct areas. Therefore, a(2) = 17.
		

Crossrefs

Programs

  • Mathematica
    a[k_] := Block[{v={},r,s,t}, Do[ If[r <= s && 4 k^2 < r s <= 12 k^2 && IntegerQ[t = 4 k^2 (r + s)/(r s - 4 k^2)] && t >= s, AppendTo[v, r + s + t]], {r, Floor[2 Sqrt[3] k]}, {s, Floor[4 k^2/r], Ceiling[12 k^2/r]}]; Length@ Union@ v]; Array[a, 20] (* Giovanni Resta, Mar 04 2020 *)
  • Python
    from math import sqrt
    def A332689(n):
        L = []; k = 4*n*n
        for x in range(1, int(2*sqrt(3)*n) + 1):
            for y in range(max(int(k/x) + 1, x), int((k + 2*n*sqrt(k + x*x))/x) + 1):
                if k*(x+y)%(x*y-k) == 0:
                    s = x + y + k*(x+y)//(x*y-k)
                    if s not in L: L.append(s)
        return len(L)  # Ya-Ping Lu, Dec 28 2023

Extensions

a(8)-a(54) from Giovanni Resta, Mar 04 2020