OFFSET
0,3
COMMENTS
All terms of this sequence are triangular numbers. Graphically, for each term of the sequence, one corner of the square will be part of the corresponding triangle's hypotenuse if the term is an odd number. Otherwise, it will not be part of it.
a(A276915(n)) is a triangular pentagonal number.
LINKS
Daniel Poveda Parrilla, Table of n, a(n) for n = 0..10000
Daniel Poveda Parrilla, Illustration of initial terms.
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(n) = n*(2*n + (-1)^n).
a(n) = n*A168277(n + 1).
From Colin Barker, Sep 23 2016: (Start)
G.f.: x*(1 + 9*x + 3*x^2 + 3*x^3) / ((1 - x)^3*(1 + x)^2).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4.
a(n) = n*(2*n+1) for n even.
a(n) = n*(2*n-1) for n odd. (End)
E.g.f.: x*( 2*(1+x)*exp(x) - exp(-x) ). - G. C. Greubel, Aug 19 2022
Sum_{n>=1} 1/a(n) = 2 - log(2). - Amiram Eldar, Aug 21 2022
MATHEMATICA
Table[n (2 n + (-1)^n), {n, 0, 48}] (* Michael De Vlieger, Sep 23 2016 *)
PROG
(PARI) concat(0, Vec(x*(1+9*x+3*x^2+3*x^3)/((1-x)^3*(1+x)^2) + O(x^50))) \\ Colin Barker, Sep 23 2016
(Magma) [n*(2*n+(-1)^n): n in [0..40]]; // G. C. Greubel, Aug 19 2022
(SageMath) [n*(2*n+(-1)^n) for n in (0..40)] # G. C. Greubel, Aug 19 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Daniel Poveda Parrilla, Sep 22 2016
STATUS
approved