OFFSET
0,2
COMMENTS
Consider a grid of small triangles of side 1 forming polygon with side n*(n+3): a(n) is the number of equilateral triangles of side length >=1 in this figure that are oriented with the sides of figure.
This sequence gives the number of triangles of all sizes in a ((n^2+3*n))-iamond with a 3*(2*n-1)-gon n>=1.
Equals (1/2)*Sum_{i=0..n-1} (n-i)*(n+1-i) + (-3 + (1/8)*Sum_{j=0..(2*n+3+(-1)^n)/4} (2*n+5-(-1)^n-4*j)*(2 n+5+(-1)^n-4*j) ) numbers of triangles in a direction and in the opposite direction.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Luce ETIENNE, Illustration of initial terms.
Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1).
FORMULA
G.f.: x*(2*x^3-3*x^2-x+5) / ((x-1)^4*(x+1)). - Colin Barker, Apr 07 2015
a(n) = 3*a(n-1)-2*a(n-2)-2*a(n-3)+3*a(n-4)-a(n-5) for n>4. - Colin Barker, Apr 07 2015
EXAMPLE
From third comment: a(0)=0, a(1)=1+4, a(2)=4+10, a(3)=10+19, a(4)=20+31, a(5)=35+47, a(6)=56+67.
MATHEMATICA
Table[(4 n^3 + 22 n^2 + 52 n + 1 - (-1)^n)/16, {n, 0, 50}] (* Vincenzo Librandi, Apr 08 2015 *)
LinearRecurrence[{3, -2, -2, 3, -1}, {0, 5, 14, 29, 51}, 50] (* Harvey P. Dale, Aug 18 2020 *)
PROG
(PARI) concat(0, Vec(x*(2*x^3-3*x^2-x+5)/((x-1)^4*(x+1)) + O(x^100))) \\ Colin Barker, Apr 07 2015
(Magma) [(4*n^3+22*n^2+52*n+1-(-1)^n)/16: n in [0..50]]; // Vincenzo Librandi, Apr 08 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Luce ETIENNE, Apr 07 2015
STATUS
approved