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 A087960 #61 Dec 31 2023 10:14:43 %S A087960 1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1, %T A087960 1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1, %U A087960 -1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1 %N A087960 a(n) = (-1)^binomial(n+1,2). %C A087960 Period 4: repeat [1, -1, -1, 1]. - _Joerg Arndt_, Feb 14 2016 %C A087960 Also equal to the sign of product(j-i, 1<=j<i<=n+1) = the sign of the Vandermonde determinant for -1, -2, ..., -(n+1). %C A087960 Hankel transform of A097331, A097332. [_Paul Barry_, Aug 10 2009] %C A087960 The Kn22 sums, see A180662, of triangle A108299 equal the terms of this sequence. [_Johannes W. Meijer_, Aug 14 2011] %D A087960 I. S. Gradstein and I. M. Ryshik, Tables of series, products, and integrals, Volume 1, Verlag Harri Deutsch, 1981. %H A087960 Gary Detlefs and Wolfdieter Lang, <a href="https://arxiv.org/abs/2304.12937">Improved Formula for the Multi-Section of the Linear Three-Term Recurrence Sequence</a>, arXiv:2304.12937 [math.CO], 2023. %H A087960 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,-1). %F A087960 a(n) = (-1)^A000217(n). %F A087960 a(n) = (-1)^floor((n+1)/2). - _Benoit Cloitre_ and _Ray Chandler_, Sep 19 2003 %F A087960 G.f.: (1-x)/(1+x^2). - _Paul Barry_, Aug 10 2009 %F A087960 a(n) = I^(n*(n+1)). - _Bruno Berselli_, Oct 17 2011 %F A087960 a(n) = Product_{k=1..n} 2*cos(2*k*Pi/(2*n+1)) for n>=0 (for n=0 the empty product is put to 1). See the Gradstein-Ryshik reference, p. 63, 1.396 2. with x = sqrt(-1). - _Wolfdieter Lang_, Oct 22 2013 %F A087960 a(n) + a(n-2) = 0 for n>1, a(n) = a(n-4) for n>3. - _Wesley Ivan Hurt_, Jul 07 2016 %F A087960 E.g.f.: cos(x) - sin(x). - _Ilya Gutkovskiy_, Jul 07 2016 %F A087960 a(n) = Sum_{s=0..n} (-1)^(n-s)*A111125(n, s)*2^s (row polynomials of signed A111125 evaluated at 2). - _Wolfdieter Lang_, May 02 2021 %e A087960 a(1) = -1 since (-1)^binomial(2,2) = (-1)^1 = -1. %e A087960 G.f. = 1 - x - x^2 + x^3 + x^4 - x^5 - x^6 + x^7 + x^8 - x^9 - x^10 + ... %p A087960 A087960:=n->(-1)^binomial(n+1,2): seq(A087960(n), n=0..100); # _Wesley Ivan Hurt_, Jul 07 2016 %t A087960 (-1)^Binomial[Range[0,110],2] (* or *) LinearRecurrence[{0,-1},{1,1},110] (* _Harvey P. Dale_, Jul 07 2014 *) %t A087960 a[ n_] := (-1)^(n (n + 1) / 2); (* _Michael Somos_, Jul 20 2015 *) %t A087960 a[ n_] := (-1)^Quotient[ n + 1, 2]; (* _Michael Somos_, Jul 20 2015 *) %o A087960 (PARI) {a(n) = (-1)^((n + 1)\2)}; /* _Michael Somos_, Jul 20 2015 */ %o A087960 (Haskell) %o A087960 a087960 n = (-1) ^ (n * (n + 1) `div` 2) %o A087960 a087960_list = cycle [1,-1,-1,1] -- _Reinhard Zumkeller_, Nov 15 2015 %o A087960 (Magma) [(-1)^Binomial(n+1,2) : n in [0..100]]; // _Wesley Ivan Hurt_, Jul 07 2016 %o A087960 (Python) %o A087960 def A087960(n): return -1 if n+1&2 else 1 # _Chai Wah Wu_, Jan 31 2023 %Y A087960 Cf. A000217, A021913, A057077, A097331, A097332, A108299, A111125, A180662. %K A087960 sign,easy %O A087960 0,1 %A A087960 _W. Edwin Clark_, Sep 17 2003 %E A087960 More terms from _Benoit Cloitre_ and _Ray Chandler_, Sep 19 2003 %E A087960 Offset and Vandermonde formula corrected by _R. J. Mathar_, Sep 25 2009