A147685 Squares and centered square numbers interleaved.
0, 1, 1, 5, 4, 13, 9, 25, 16, 41, 25, 61, 36, 85, 49, 113, 64, 145, 81, 181, 100, 221, 121, 265, 144, 313, 169, 365, 196, 421, 225, 481, 256, 545, 289, 613, 324, 685, 361, 761, 400, 841, 441, 925, 484, 1013, 529, 1105, 576, 1201, 625, 1301, 676, 1405, 729, 1513
Offset: 0
Examples
G.f. = x + x^2 + 5*x^3 + 4*x^4 + 13*x^5 + 9*x^6 + 25*x^7 + 16*x^8 + 41*x^9 + ...
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (0, 3, 0, -3, 0, 1).
Programs
-
Maple
A147685:=n->n^2*(1+(-1)^n)/8+(n^2+1)*(1-(-1)^n)/4: seq(A147685(n), n=0..70); # Wesley Ivan Hurt, Sep 06 2015
-
Mathematica
CoefficientList[Series[x (1 + x + x^2) (1 + x^2)/((1 - x)^3 (1 + x)^3), {x, 0, 50}], x] (* Vincenzo Librandi, Aug 07 2014 *)
-
PARI
{a(n) = if( n%2, (n^2 + 1) / 2, n^2 / 4)}; /* Michael Somos, Aug 07 2014 */
Formula
O.g.f.: x*(1+x+x^2)*(1+x^2)/((1-x)^3*(1+x)^3).
a(n) = 3*a(n-2) - 3*a(n-4) + a(n-6), n>5.
Euler transform of length 4 sequence [ 1, 4, -1, -1]. - Michael Somos, Aug 07 2014
a(2n+1) = a(2n) + a(2n+2) for all n in Z. - Michael Somos, Aug 07 2014
A120328(n-1) = 3*n^2 + 2 = a(2*n + 1) - a(2*n)+ a(2*n - 1) for all n in Z. - Michael Somos, Aug 07 2014
a(n) = n^2*(1+(-1)^n)/8+(n^2+1)*(1-(-1)^n)/4. - Wesley Ivan Hurt, Sep 06 2015
Comments