A045949 Number of equilateral triangles formed out of matches that can be found in a hexagonal chunk of side length n in hexagonal array of matchsticks.
0, 6, 38, 116, 262, 496, 840, 1314, 1940, 2738, 3730, 4936, 6378, 8076, 10052, 12326, 14920, 17854, 21150, 24828, 28910, 33416, 38368, 43786, 49692, 56106, 63050, 70544, 78610, 87268, 96540, 106446, 117008, 128246, 140182, 152836, 166230, 180384, 195320, 211058
Offset: 0
Keywords
Links
- N. J. A. Sloane, Illustration of a(1)=6
- Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1). [From _R. J. Mathar_, Sep 03 2010]
Crossrefs
Programs
-
GAP
List([0..40], n-> (28*n^3 +18*n^2 +4*n -1 +(-1)^n)/8); # G. C. Greubel, Apr 05 2019
-
Magma
[(28*n^3 +18*n^2 +4*n -1 +(-1)^n)/8: n in [0..40]]; // G. C. Greubel, Apr 05 2019
-
Mathematica
LinearRecurrence[{3,-2,-2,3,-1},{0,6,38,116,262},40] (* or *) CoefficientList[Series[(2*x*(x*(x+2)*(x+5)+3))/((x-1)^4*(x+1)),{x,0,40}],x] (* Harvey P. Dale, Jun 11 2011 *)
-
Maxima
A045949(n):=floor(n*(14*n^2+9*n+2)/4)$ makelist(A045949(n),n,0,30); /* Martin Ettl, Nov 03 2012 */
-
PARI
{a(n) = (28*n^3 +18*n^2 +4*n -1 +(-1)^n)/8}; \\ G. C. Greubel, Apr 05 2019
-
R
floor(1:25*(14*(1:25)^2+9*(1:25)+2)/4) # Christian N. K. Anderson, Apr 27 2013
-
Sage
[(28*n^3 +18*n^2 +4*n -1 +(-1)^n)/8 for n in (0..40)] # G. C. Greubel, Apr 05 2019
Formula
a(n) = floor(n*(14*n^2 + 9*n + 2)/4).
From R. J. Mathar, Sep 03 2010: (Start)
a(n) = +3*a(n-1) -2*a(n-2) -2*a(n-3) +3*a(n-4) -a(n-5).
G.f.: 2*x*(3+10*x+7*x^2+x^3) / ( (1+x)*(1-x)^4 ).
a(n) = (28*n^3 + 18*n^2 + 4*n - 1 + (-1)^n)/8. (End)
E.g.f.: (x*(25 + 51*x + 14*x^2)*exp(x) - sinh(x))/4. - G. C. Greubel, Apr 05 2019
Extensions
Edited by N. J. A. Sloane, May 29 2012