OFFSET
0,2
COMMENTS
For n > 0, first differences of A304487.
All the terms of this sequence are odd numbers.
LINKS
Stefano Spezia, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 3.
a(2*n) = A188135(n).
a(2*n-1) = A033567(n), for n > 0.
O.g.f.: -(1 + x + 5*x^2 + x^3)/(-1 + x)^3*(1 + x).
E.g.f.: (1/2)*exp(-x)*(1 + exp(2*x)*(1 + 6*x + 4*x^2)).
Sum_{n>0} 1/a(n) = (1/4)*(Pi - log(4)) + i*(polygamma(0, 1/8 - i*sqrt(7)/8) - polygamma(0, 1/8 + i*sqrt(7)/8))/(2*sqrt(7)) = 1.603596691017309384564895..., where i is the imaginary unit. - Stefano Spezia, Feb 10 2019
a(n) = 1 + 2*(n^2 + floor(n/2)). - Stefano Spezia, Dec 08 2021
MAPLE
a:=n->(1/2)*(1 + (-1)^n + 2*n + 4*n^2): seq(a(n), n=0..50);
MATHEMATICA
a[n_]:=(1/2)*(1 + (-1)^n + 2*n + 4*n^2); Array[a, 50, 0]
PROG
(GAP) Flat(List([0..50], n->(1/2)*(1 + (-1)^n + 2*n + 4*n^2)));
(Magma) [(1/2)*(1+(-1)^n+2*n+4*n^2): n in [0..50]];
(Maxima) makelist((1/2)*(1+(-1)^n+2*n+4*n^2), n, 0, 50);
(PARI) a(n) = (1/2)*(1+(-1)^n+2*n+4*n^2);
(Python) [(1+(-1)**n+2*n+4*n**2)/2 for n in range(0, 50)]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Stefano Spezia, Jan 22 2019
STATUS
approved