This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A374157 #28 Jul 01 2024 02:09:42 %S A374157 0,1,-2,-3,4,5,-6,-7,8,9,-10,-11,12,13,-14,-15,16,17,-18,-19,20,21, %T A374157 -22,-23,24,25,-26,-27,28,29,-30,-31,32,33,-34,-35,36,37,-38,-39,40, %U A374157 41,-42,-43,44,45,-46,-47,48,49,-50,-51,52,53,-54,-55,56,57,-58,-59 %N A374157 a(n) = (-1)^floor(n/2)*n. %C A374157 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. %H A374157 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,-2,0,-1). %F A374157 Sum_{n>=1} 1/a(n) = Pi/4 - log(2)/2 = A196521. %F A374157 a(n) = [x^n] -x*(x^2 + 2*x - 1)/(x^2 + 1)^2. %F A374157 a(n) = n! * [x^n] x*(cos(x) - sin(x)). - _Stefano Spezia_, Jun 30 2024 %F A374157 a(n) = n*A057077(n). - _Michel Marcus_, Jul 01 2024 %p A374157 a := n -> (-1)^iquo(n, 2)*n: seq(a(n), n = 0..59); %t A374157 Array[(-1)^Floor[#/2]*# &, 60, 0] (* _Michael De Vlieger_, Jun 30 2024 *) %o A374157 (Python) %o A374157 def A374157(n): return (-1)**(n // 2)*n %o A374157 (Python) %o A374157 def A374157(n): return -n if n&2 else n # _Chai Wah Wu_, Jun 30 2024 %o A374157 (PARI) a(n) = (-1)^(n\2) * n; \\ _Amiram Eldar_, Jun 30 2024 %Y A374157 Cf. A005408, A001057, A057077, A196521, A372728. %Y A374157 Cf. A001477, A181983. %K A374157 sign,easy %O A374157 0,3 %A A374157 _Peter Luschny_, Jun 30 2024