OFFSET
0,3
COMMENTS
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,-2,0,-1).
FORMULA
Sum_{n>=1} 1/a(n) = Pi/4 - log(2)/2 = A196521.
a(n) = [x^n] -x*(x^2 + 2*x - 1)/(x^2 + 1)^2.
a(n) = n! * [x^n] x*(cos(x) - sin(x)). - Stefano Spezia, Jun 30 2024
a(n) = n*A057077(n). - Michel Marcus, Jul 01 2024
MAPLE
a := n -> (-1)^iquo(n, 2)*n: seq(a(n), n = 0..59);
MATHEMATICA
Array[(-1)^Floor[#/2]*# &, 60, 0] (* Michael De Vlieger, Jun 30 2024 *)
PROG
(Python)
def A374157(n): return (-1)**(n // 2)*n
(Python)
def A374157(n): return -n if n&2 else n # Chai Wah Wu, Jun 30 2024
(PARI) a(n) = (-1)^(n\2) * n; \\ Amiram Eldar, Jun 30 2024
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Peter Luschny, Jun 30 2024
STATUS
approved