OFFSET
0,2
COMMENTS
Consider a grid of small triangles of side 1 forming a regular polygon with side n*(n+2); a(n) is the number of equilateral triangles of side length >= 1 in this figure which are oriented with the sides of the figure.
This sequence gives the number of triangles of all sizes in a (n^2+2*n)-iamond with a 4*n-gon configuration.
Equals (1/2)*Sum_{j=0..n-1} (n-j)*(n+1-j) + (-1 + (1/8)*Sum_{j=0..(2*n+1-(-1)^n)/4} (2*n+3+(-1)^n-4*j)*(2*n+3-(-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 for a(1), a(2), a(3), a(4), a(5)
Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1).
FORMULA
G.f.: x*(x^3-2*x^2+x+3) / ((x-1)^4*(x+1)). - Colin Barker, Mar 03 2015
a(n) = 3*a(n-1)-2*a(n-2)-2*a(n-3)+3*a(n-4)-a(n-5). - Colin Barker, Mar 03 2015
EXAMPLE
From third comment: a(0)=0, a(1)=1+2, a(2)=4+6, a(3)=10+12, a(4)=20+21, a(5)=35+33.
MATHEMATICA
CoefficientList[Series[x (x^3 - 2 x^2 + x + 3) / ((x - 1)^4(x + 1)), {x, 0, 50}], x] (* Vincenzo Librandi, Mar 21 2015 *)
LinearRecurrence[{3, -2, -2, 3, -1}, {0, 3, 10, 22, 41}, 50] (* Harvey P. Dale, Jan 17 2023 *)
PROG
(PARI) concat(0, Vec(x*(x^3-2*x^2+x+3)/((x-1)^4*(x+1)) + O(x^100))) \\ Colin Barker, Mar 03 2015
(Magma) [(4*n^3+18*n^2+28*n-(1-(-1)^n)) div 16: n in [0..50]]; // Vincenzo Librandi, Mar 21 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Luce ETIENNE, Mar 03 2015
EXTENSIONS
Typo in formula fixed by Vincenzo Librandi, Mar 21 2015
Name rewritten using the closed form by Bruno Berselli, Apr 19 2015
STATUS
approved