cp's OEIS Frontend

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.

A057077 Periodic sequence 1,1,-1,-1; expansion of (1+x)/(1+x^2).

This page as a plain text file.
%I A057077 #99 Aug 13 2025 10:19:53
%S A057077 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 A057077 -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 A057077 -1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1
%N A057077 Periodic sequence 1,1,-1,-1; expansion of (1+x)/(1+x^2).
%C A057077 Abscissa of the image produced after n alternating reflections of (1,1) over the x and y axes respectively.  Similarly, the ordinate of the image produced after n alternating reflections of (1,1) over the y and x axes respectively. - _Wesley Ivan Hurt_, Jul 06 2013
%H A057077 Alex Fink, Richard K. Guy, and Mark Krusemeyer, <a href="https://doi.org/10.11575/cdm.v3i2.61940">Partitions with parts occurring at most thrice</a>, Contributions to Discrete Mathematics, Vol 3, No 2 (2008), pp. 76-114. See Section 13.
%H A057077 T.-X. He and L. W. Shapiro, <a href="http://dx.doi.org/10.1016/j.laa.2017.06.025">Fuss-Catalan matrices, their weighted sums, and stabilizer subgroups of the Riordan group</a>, Lin. Alg. Applic. 532 (2017) 25-41, Theorem 2.5, k=2.
%H A057077 StackExchange, <a href="https://math.stackexchange.com/questions/5089715">Finding sum(k=1..oo) (-1)^(k(k+1)/2)</a>, (2025) provides Dirichlet sums.
%H A057077 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,-1).
%H A057077 <a href="/index/Ch#Cheby">Index entries for sequences related to Chebyshev polynomials.</a>
%F A057077 G.f.: (1+x)/(1+x^2).
%F A057077 a(n) = S(n, 0) + S(n-1, 0) = S(2*n, sqrt(2)); S(n, x) := U(n, x/2), Chebyshev polynomials of 2nd kind, A049310. S(n, 0)=A056594.
%F A057077 a(n) = (-1)^binomial(n,2) = (-1)^floor(n/2) = 1/2*((n+2) mod 4 - n mod 4). For fixed r = 0,1,2,..., it appears that (-1)^binomial(n,2^r) gives a periodic sequence of period 2^(r+1), the period consisting of a block of 2^r plus ones followed by a block of 2^r minus ones. See A033999 (r = 0), A143621 (r = 2) and A143622 (r = 3). Define E(k) = sum {n = 0..inf} a(n)*n^k/n! for k = 0,1,2,... . Then E(0) = cos(1) + sin(1), E(1) = cos(1) - sin(1) and E(k) is an integral linear combination of E(0) and E(1) (a Dobinski-type relation). Precisely, E(k) = A121867(k) * E(0) - A121868(k) * E(1). See A143623 and A143624 for the decimal expansions of E(0) and E(1) respectively. For a fixed value of r, similar relations hold between the values of the sums E_r(k) := Sum_{n>=0} (-1)^floor(n/r)*n^k/n!, k = 0,1,2,... . For particular cases see A000587 (r = 1) and A143628 (r = 3). - _Peter Bala_, Aug 28 2008
%F A057077 Sum_{k>=0} a(k)/(k+1) = Sum_{k>=0} 1/((a(k)*(k+1))) = log(2)/2 + Pi/4. - _Jaume Oliver Lafont_, Apr 30 2010
%F A057077 a(n) = (-1)^A180969(1,n), where the first index in A180969(.,.) is the row index. - _Adriano Caroli_, Nov 18 2010
%F A057077 a(n) = (-1)^((2*n+(-1)^n-1)/4) = i^((n-1)*n), with i=sqrt(-1). - _Bruno Berselli_, Dec 27 2010 - Aug 26 2011
%F A057077 Non-simple continued fraction expansion of (3+sqrt(5))/2 = A104457. - _R. J. Mathar_, Mar 08 2012
%F A057077 E.g.f.: cos(x)*(1 + tan(x)). - _Arkadiusz Wesolowski_, Aug 31 2012
%F A057077 From _Ricardo Soares Vieira_, Oct 15 2019: (Start)
%F A057077 E.g.f.: sin(x) + cos(x) = sqrt(2)*sin(x + Pi/4).
%F A057077 a(n) = sqrt(2)*(d^n/dx^n) sin(x)|_x=Pi/4, i.e., a(n) equals sqrt(2) times the n-th derivative of sin(x) evaluated at x=Pi/4. (End)
%F A057077 a(n) = 4*floor(n/4) - 2*floor(n/2) + 1. - _Ridouane Oudra_, Mar 23 2024
%p A057077 seq((-1)^floor(k/2),k=0..70); # _Wesley Ivan Hurt_, Jul 06 2013
%p A057077 A057077 := proc(n)
%p A057077     op(1+(n mod 4),[1,1,-1,-1]) ;
%p A057077 end proc:
%p A057077 seq(A057077(n),n=0..40) ; # _R. J. Mathar_, Feb 27 2025
%t A057077 a[n_] := {1, 1, -1, -1}[[Mod[n, 4] + 1]] (* _Jean-François Alcover_, Jul 05 2013 *)
%t A057077 PadRight[{},80,{1,1,-1,-1}] (* _Harvey P. Dale_, Jun 21 2015 *)
%o A057077 (Maxima) A057077(n) := block(
%o A057077         [1,1,-1,-1][1+mod(n,4)]
%o A057077 )$ /* _R. J. Mathar_, Mar 19 2012 */
%o A057077 (Magma) &cat[[1, 1, -1, -1]^^20]; // _Vincenzo Librandi_, Feb 18 2016
%o A057077 (PARI) a(n)=(-1)^(n\2) \\ _Charles R Greathouse IV_, Nov 07 2016
%o A057077 (Python)
%o A057077 def A057077(n): return -1 if n&2 else 1 # _Chai Wah Wu_, Jun 30 2024
%Y A057077 |a(n)|=A000012. Cf. A049310.
%Y A057077 Cf. A000587, A121867, A121868, A130151, A143621, A143622, A143623, A143624, A143628.
%K A057077 sign,easy
%O A057077 0,1
%A A057077 _Wolfdieter Lang_, Aug 04 2000