A216852 18k^2-36k+9 interleaved with 18k^2-18k+9 for k>=0.
9, 9, -9, 9, 9, 45, 63, 117, 153, 225, 279, 369, 441, 549, 639, 765, 873, 1017, 1143, 1305, 1449, 1629, 1791, 1989, 2169, 2385, 2583, 2817, 3033, 3285, 3519, 3789, 4041, 4329, 4599, 4905, 5193, 5517, 5823, 6165, 6489, 6849, 7191, 7569, 7929, 8325, 8703
Offset: 0
Links
- Eddie Gutierrez New Interleaved Sequences Part B on oddwheel.com, Section B1 Line No. 22 (square_sequencesII.html) Part B
- Index entries for linear recurrences with constant coefficients, signature (2, 0, -2, 1).
Programs
-
Magma
&cat[[18*k^2-36*k+9, 18*k^2-18*k+9]: k in [0..23]]; // Bruno Berselli, Oct 01 2012
-
Mathematica
Flatten[Table[{18 n^2 - 36 n + 9, 18 n^2 - 18 n + 9}, {n, 0, 23}]] (* Bruno Berselli, Oct 01 2012 *) Flatten[Table[18n^2+9-{36n,18n},{n,0,50}]] (* or *) LinearRecurrence[ {2,0,-2,1},{9,9,-9,9},100] (* Harvey P. Dale, Apr 26 2014 *)
-
PARI
vector(47, n, k=(n-1)\2; if(n%2, 18*k^2-36*k+9, 18*k^2-18*k+9)) \\ Bruno Berselli, Oct 01 2012
Formula
From Bruno Berselli, Oct 01 2012: (Start)
G.f.: 9*(1-x-3*x^2+5*x^3)/((1+x)*(1-x)^3).
a(n) = (9/4)*(2*n*(n-4)-3*(-1)^n+7).
a(0)=9, a(1)=9, a(2)=-9, a(3)=9, a(n)=2*a(n-1)-2*a(n-3)+a(n-4). - Harvey P. Dale, Apr 26 2014
Extensions
Definition rewritten by Bruno Berselli, Oct 25 2012
Comments