OFFSET
3,2
LINKS
Colin Barker, Table of n, a(n) for n = 3..1000
W. C. Yang, R. R. Meyer, Maximal and minimal polyiamonds, 2002.
Index entries for linear recurrences with constant coefficients, signature (1,1,0,-1,-1,1).
FORMULA
From Colin Barker, Jan 18 2015: (Start)
a(n) = round((-25 + 9*(-1)^n + 8*exp(-2/3*i*n*Pi) + 8*exp((2*i*n*Pi)/3) + 6*n^2)/36), where i=sqrt(-1).
G.f.: x^3*(1+x-x^2)*(1+x^2) / ((1-x)^3*(1+x)*(1+x+x^2)). (End)
EXAMPLE
a(10) = 16 because the maximum number of triangles in a polyiamond of perimeter 10 is 16.
MAPLE
A069813 := proc(n)
round(n^2/6) ;
if modp(n, 6) <> 0 then
%-1 ;
else
% ;
end if;
end proc: # R. J. Mathar, Jul 14 2015
MATHEMATICA
LinearRecurrence[{1, 1, 0, -1, -1, 1}, {1, 2, 3, 6, 7, 10}, 60] (* Jean-François Alcover, Jan 03 2020 *)
PROG
(PARI) a(n) = round(n^2/6) - (n % 6 != 0) \\ Michel Marcus, Jul 17 2013
(PARI) Vec(x^3*(x^2-x-1)*(x^2+1)/((x-1)^3*(x+1)*(x^2+x+1)) + O(x^60)) \\ Colin Barker, Jan 19 2015
(Magma) R<x>:=PowerSeriesRing(Integers(), 65); Coefficients(R!( x^3*(x^2-x-1)*(x^2+1)/((x-1)^3*(x+1)*(x^2+x+1)))); // Marius A. Burtea, Jan 03 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Winston C. Yang (winston(AT)cs.wisc.edu), Apr 30 2002
STATUS
approved