This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A045949 #58 Mar 21 2025 13:08:03 %S A045949 0,6,38,116,262,496,840,1314,1940,2738,3730,4936,6378,8076,10052, %T A045949 12326,14920,17854,21150,24828,28910,33416,38368,43786,49692,56106, %U A045949 63050,70544,78610,87268,96540,106446,117008,128246,140182,152836,166230,180384,195320,211058 %N 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. %H A045949 N. J. A. Sloane, <a href="/A045949/a045949.jpg">Illustration of a(1)=6</a> %H A045949 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,-2,3,-1). [From _R. J. Mathar_, Sep 03 2010] %F A045949 a(n) = floor(n*(14*n^2 + 9*n + 2)/4). %F A045949 From _R. J. Mathar_, Sep 03 2010: (Start) %F A045949 a(n) = +3*a(n-1) -2*a(n-2) -2*a(n-3) +3*a(n-4) -a(n-5). %F A045949 G.f.: 2*x*(3+10*x+7*x^2+x^3) / ( (1+x)*(1-x)^4 ). %F A045949 a(n) = (28*n^3 + 18*n^2 + 4*n - 1 + (-1)^n)/8. (End) %F A045949 a(n) = A033581(n) + A307253(n). - _John King_, Apr 04 2019 %F A045949 E.g.f.: (x*(25 + 51*x + 14*x^2)*exp(x) - sinh(x))/4. - _G. C. Greubel_, Apr 05 2019 %t A045949 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 *) %o A045949 (Maxima) A045949(n):=floor(n*(14*n^2+9*n+2)/4)$ %o A045949 makelist(A045949(n),n,0,30); /* _Martin Ettl_, Nov 03 2012 */ %o A045949 (R) floor(1:25*(14*(1:25)^2+9*(1:25)+2)/4) # _Christian N. K. Anderson_, Apr 27 2013 %o A045949 (PARI) {a(n) = (28*n^3 +18*n^2 +4*n -1 +(-1)^n)/8}; \\ _G. C. Greubel_, Apr 05 2019 %o A045949 (Magma) [(28*n^3 +18*n^2 +4*n -1 +(-1)^n)/8: n in [0..40]]; // _G. C. Greubel_, Apr 05 2019 %o A045949 (Sage) [(28*n^3 +18*n^2 +4*n -1 +(-1)^n)/8 for n in (0..40)] # _G. C. Greubel_, Apr 05 2019 %o A045949 (GAP) List([0..40], n-> (28*n^3 +18*n^2 +4*n -1 +(-1)^n)/8); # _G. C. Greubel_, Apr 05 2019 %Y A045949 See A008893 for a related sequence. %Y A045949 For hexagons, the number of matches required is A045945, the number of size=1 triangles is A033581, the larger triangles is A307253 and the total number is A045949. For the analogs for triangles see A045943 and for stars see A045946. - _John King_, Apr 05 2019 %K A045949 nonn %O A045949 0,2 %A A045949 _R. K. Guy_ %E A045949 Edited by _N. J. A. Sloane_, May 29 2012