OFFSET
1,3
COMMENTS
LINKS
Guenther Schrack, Table of n, a(n) for n = 1..10002
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
FORMULA
Starting (1, 2, 4, 6, ...) = partial sums of (1, 1, 2, 2, 1, 1, 2, 2, ...). - Gary W. Adamson, Jun 19 2008
G.f.: x^2*(1+2*x^2) / ((1+x^2)*(1-x)^2). - R. J. Mathar, Oct 08 2011
From Wesley Ivan Hurt, May 21 2016: (Start)
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>4.
a(n) = (6*n - 8 + i^(1-n) - i^(1+n))/4 where i=sqrt(-1).
From Guenther Schrack, Feb 11 2019: (Start)
a(n) = (6*n - 8 + (1 - (-1)^n)*(-1)^(n*(n-1)/2))/4.
a(n) = a(n-4) + 6, a(1)=0, a(2)=1, a(3)=2, a(4)=4, for n > 4.
a(-n) = -A047262(n+2).
a(n) = A118286(n-1)/2 for n > 1.
a(n) = A047255(n) - 1. (End)
Sum_{n>=2} (-1)^n/a(n) = sqrt(3)*Pi/36 + log(2)/3 + log(3)/4. - Amiram Eldar, Dec 16 2021
MAPLE
MATHEMATICA
Table[(6n-8+I^(1-n)-I^(1+n))/4, {n, 80}] (* Wesley Ivan Hurt, May 21 2016 *)
LinearRecurrence[{2, -2, 2, -1}, {0, 1, 2, 4}, 120] (* Harvey P. Dale, Jan 21 2018 *)
PROG
(Magma) [n : n in [0..110] | n mod 6 in [0, 1, 2, 4]]; // G. C. Greubel, Feb 16 2019
(PARI) my(x='x+O('x^70)); concat([0], Vec(x^2*(1+2*x^2)/((1+x^2)*(1-x)^2))) \\ G. C. Greubel, Feb 16 2019
(Sage) a=(x^2*(1+2*x^2)/((1+x^2)*(1-x)^2)).series(x, 72).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 16 2019
(GAP) Filtered([0..100], n->n mod 6 = 0 or n mod 6 = 1 or n mod 6 = 2 or n mod 6 = 4); # Muniru A Asiru, Feb 19 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Wesley Ivan Hurt, May 21 2016
STATUS
approved