OFFSET
1,2
COMMENTS
Number of edges needed in a sector of a hexagon of size n paved by rhombi coming from triangular/hexagonal lattices.
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
FORMULA
a(n) = n^2+(n+1)/3 with integer division, that is n mod 3 = 0 : n^2+n/3 n mod 3 = 1 : n^2+(n-1)/3 n mod 3 = 2 : n^2+(n+1)/3.
G.f.: x*(1+3*x+x^2+x^3)/(1-x)^3/(1+x+x^2). [Colin Barker, Feb 12 2012]
MATHEMATICA
Accumulate[Select[Range[100], MemberQ[{1, 4, 5}, Mod[#, 6]]&]] (* Harvey P. Dale, Aug 16 2012 *)
PROG
(Java or beanShell script) for(int i=1, s=m=0; i<40; i++) { m= i%6; if((m==1)||(m==4)||(m==5)) System.out.print((s+=i)+", "); } for(int i=1; i<20; i++) System.out.print((i*i+(i+1)/3)+" ");
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Christian Mercat (Integer.Sequence(AT)entrelacs.net), Mar 20 2003
STATUS
approved