login
A269112
a(n) = (3*(n-1)*n + (-1)^((n-1)*n/2) + 5)/2.
1
3, 5, 11, 21, 33, 47, 65, 87, 111, 137, 167, 201, 237, 275, 317, 363, 411, 461, 515, 573, 633, 695, 761, 831, 903, 977, 1055, 1137, 1221, 1307, 1397, 1491, 1587, 1685, 1787, 1893, 2001, 2111, 2225, 2343, 2463, 2585, 2711, 2841, 2973, 3107, 3245, 3387, 3531, 3677, 3827
OFFSET
1,1
FORMULA
G.f.: x*(3 - 4*x + 8*x^2 - 4*x^3 + 3*x^4)/((1 + x^2)*(1 - x)^3).
a(n) = (3*n^2 - 3*n + cos(n*Pi/2) + sin(n*Pi/2) + 5)/2.
a(n) = 3*(n-1)^2 - 3*(n-1) - a(n-2) + 8 for n>2.
a(n) = 3*a(n-1) - 4*a(n-2) + 4*a(n-3) - 3*a(n-4) + a(n-5) for n>5. - Colin Barker, Feb 22 2016
a(n) = A047270(A000124(n-1)). - Bruno Berselli, Feb 23 2016
MATHEMATICA
Table[(3 (n - 1) n + (-1)^((n - 1) n/2) + 5)/2, {n, 100}]
LinearRecurrence[{3, -4, 4, -3, 1}, {3, 5, 11, 21, 33}, 100]
CoefficientList[Series[(3-4*x+8*x^2-4*x^3+3*x^4)/((1+x^2)*(1-x)^3), {x, 0, 100}], x]
PROG
(PARI) Vec((3-4*x+8*x^2-4*x^3+3*x^4)/((1+x^2)*(1-x)^3) + O(x^60)) \\ Michel Marcus, Feb 22 2016
(Magma) I:=[3, 5]; [n le 2 select I[n] else 3*(n-1)^2-3*(n-1)- Self(n-2)+8: n in [1..50]]; // Vincenzo Librandi, Feb 22 2016
(Sage) [(3*(n-1)*n+(-1)^((n-1)*n/2)+5)/2 for n in (1..50)] # Bruno Berselli, Feb 23 2016
CROSSREFS
Sequence in context: A082713 A074710 A057460 * A093328 A045515 A298342
KEYWORD
nonn,easy
AUTHOR
Mikk Heidemaa, Feb 19 2016
EXTENSIONS
Edited by Bruno Berselli, Feb 23 2016
STATUS
approved