A307985 Number of integer-sided triangles with perimeter n and sides a, b, and c such that a <= b <= c and b|n.
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
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..19683
- Wikipedia, Integer Triangle
- Index entries for linear recurrences with constant coefficients, signature (0,0,1,0,0,1,0,0,-1).
Programs
-
Mathematica
Table[Sum[Sum[(1 - Ceiling[n/i] + Floor[n/i]) Sign[Floor[(i + k)/(n - i - k + 1)]], {i, k, Floor[(n - k)/2]}], {k, Floor[n/3]}], {n, 100}]
-
PARI
a(n) = if(n%3, 0, ceil(n/6)) \\ Jianing Song, Oct 23 2022
Formula
a(n) = Sum_{k=1..floor(n/3)} Sum_{i=k..floor((n-k)/2)} sign(floor((i+k)/(n-i-k+1)) * (1 - ceiling(n/i) + floor(n/i))).
Conjectures from Colin Barker, May 15 2019: (Start)
G.f.: x^3 / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)^2).
a(n) = a(n-3) + a(n-6) - a(n-9) for n>9.
(End) [The conjectures are correct. - Jianing Song, Oct 23 2022]
a(n) = ceiling(n/6) = A110654(n/3) for n divisible by 3; otherwise a(n) = 0. - Jianing Song, Oct 23 2022
Comments