login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A374157 a(n) = (-1)^floor(n/2)*n. 3
0, 1, -2, -3, 4, 5, -6, -7, 8, 9, -10, -11, 12, 13, -14, -15, 16, 17, -18, -19, 20, 21, -22, -23, 24, 25, -26, -27, 28, 29, -30, -31, 32, 33, -34, -35, 36, 37, -38, -39, 40, 41, -42, -43, 44, 45, -46, -47, 48, 49, -50, -51, 52, 53, -54, -55, 56, 57, -58, -59 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
For all odd numbers n (A005408) and all whole numbers z (A001057) K(z/n) = K(a(n)/z), where K(z/n) denotes the Kronecker symbol (A372728). This fact is equivalent to the law of quadratic reciprocity and its first and second supplement.
LINKS
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
Sequence in context: A024000 A181983 A274922 * A097141 A160356 A374012
KEYWORD
sign,easy
AUTHOR
Peter Luschny, Jun 30 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 21 16:38 EDT 2024. Contains 374475 sequences. (Running on oeis4.)