A024164 Number of integer-sided triangles with sides a,b,c, a
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 2, 0, 0, 3, 0, 0, 3, 0, 0, 4, 0, 0, 4, 0, 0, 5, 0, 0, 5, 0, 0, 6, 0, 0, 6, 0, 0, 7, 0, 0, 7, 0, 0, 8, 0, 0, 8, 0, 0, 9, 0, 0, 9, 0, 0, 10, 0, 0, 10, 0, 0, 11, 0, 0, 11, 0, 0, 12, 0, 0, 12, 0, 0, 13, 0, 0, 13, 0, 0, 14, 0, 0, 14, 0, 0, 15, 0, 0, 15, 0, 0, 16, 0, 0, 16
Offset: 1
Examples
a(9) = 1 for the smallest such triangle (2, 3, 4). a(12) = 1 for Pythagorean triple (3, 4, 5). a(15) = 2 for the two triples (3, 5, 7) and (4, 5, 6).
Links
- Wikipedia, Integer Triangle
- Index entries for linear recurrences with constant coefficients, signature (0,0,1,0,0,1,0,0,-1).
Crossrefs
Cf. A336750 (triples), A336751 (smallest side), A307136 (middle side), A336753 (largest side), A336754 (perimeter), this sequence (number of triangles whose perimeter = n), A336755 (primitive triples), A336756 (primitive perimeters), A336757 (number of primitive triangles with perimeter = n).
Cf. A005044 (number of integer-sided triangles with perimeter = n).
Programs
-
Mathematica
A024164[n_] := If[Mod[n, 3] == 0, Floor[(n - 3)/6], 0]; Array[A024164, 100] (* Wesley Ivan Hurt, Nov 01 2020 *) LinearRecurrence[{0,0,1,0,0,1,0,0,-1},{0,0,0,0,0,0,0,0,1},120] (* Harvey P. Dale, Jun 03 2021 *)
Formula
If n = 3*k, then a(n) = floor((n-3)/6) = A004526((n-3)/3), otherwise, a(3k+1) = a(3k+2) = 0. - Bernard Schott, Oct 10 2020
From Wesley Ivan Hurt, Nov 01 2020: (Start)
G.f.: x^9/((x^3 - 1)^2*(x^3 + 1)).
a(n) = a(n-3) + a(n-6) - a(n-9).
a(n) = (1 - ceiling(n/3) + floor(n/3)) * floor((n-3)/6). (End)
E.g.f.: (18 + (x - 6)*cosh(x) + (x - 3)*sinh(x) - exp(-x/2)*((9 + 3*exp(x) + x)*cos(sqrt(3)*x/2) + sqrt(3)*x*sin(sqrt(3)*x/2)))/18. - Stefano Spezia, Feb 29 2024
Comments