A238829 a(n) = A238823(n) - A238826(n).
1, 1, 2, 5, 12, 31, 77, 192, 474, 1170, 2881, 7097, 17477, 43050, 106043, 261235, 643552, 1585421, 3905750, 9621993, 23704161, 58396118, 143860974, 354406732, 873093707, 2150897733, 5298813853, 13053818630, 32158552201, 79223751853, 195170567014, 480809724213
Offset: 1
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- V. M. Zhuravlev, Horizontally-convex polyiamonds and their generating functions, Mat. Pros. 17 (2013), 107-129 (in Russian). See the sequence a(n).
- Index entries for linear recurrences with constant coefficients, signature (3,0,-4,1,1,3,-1).
Programs
-
Magma
I:=[1,1,2,5,12,31,77]; [n le 7 select I[n] else 3*Self(n-1)-4*Self(n-3)+Self(n-4)+Self(n-5)+3*Self(n-6)-Self(n-7): n in [1..35]]
-
Maple
g:=proc(n) option remember; local t1; t1:=[2,3,6,14,34,84,208,515]; if n <= 7 then t1[n] else 3*g(n-1)-4*g(n-3)+g(n-4)+g(n-5)+3*g(n-6)-g(n-7); fi; end proc; [seq(g(n),n=1..32)]; # A238823 d:=proc(n) option remember; global g; local t1; t1:=[0,1]; if n <= 2 then t1[n] else g(n-1)-2*d(n-1)-d(n-2); fi; end proc; [seq(d(n),n=1..32)]; # A238824 p:=proc(n) option remember; global d; local t1; t1:=[0,0,0,1]; if n <= 4 then t1[n] else p(n-2)+p(n-3)+2*(d(n-3)+d(n-4)); fi; end proc; [seq(p(n),n=1..32)]; # A238825 h:=n->p(n+3)-p(n+1); [seq(h(n),n=1..32)]; #A238826 r:=proc(n) option remember; global p; local t1; t1:=[0,0,0,0]; if n <= 4 then t1[n] else r(n-2)+p(n-3); fi; end proc; [seq(r(n),n=1..32)]; # A238827 [0,seq(d(n-1)+p(n),n=2..32)]; #A238828 a:=n->g(n)-h(n); [seq(a(n),n=1..32)]; #A238829
-
Mathematica
CoefficientList[Series[(1 - x) (2 x^5 + x^4 + x^3 - 2 x^2 - x + 1)/(1 - 3 x + 4 x^3 - x^4 - x^5 - 3 x^6 + x^7), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 21 2014 *) LinearRecurrence[{3,0,-4,1,1,3,-1},{1,1,2,5,12,31,77},40] (* Harvey P. Dale, Jun 08 2018 *)
Formula
G.f.: -x*(x-1)*(2*x^5+x^4+x^3-2*x^2-x+1) / ( 1-3*x+4*x^3-x^4-x^5-3*x^6+x^7 ). - R. J. Mathar, Mar 20 2014