cp's OEIS Frontend

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.

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.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

See A008893 for a related sequence.
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

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)
a(n) = A033581(n) + A307253(n). - John King, Apr 04 2019
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