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 A057079 #107 Aug 04 2025 09:03:47 %S A057079 1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1, %T A057079 -2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1, %U A057079 2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1,1,2,1,-1,-2,-1 %N A057079 Periodic sequence: repeat [1,2,1,-1,-2,-1]; expansion of (1+x)/(1-x+x^2). %C A057079 Inverse binomial transform of A057083. Binomial transform of A061347. The sums of consecutive pairs of elements give A084103. - _Paul Barry_, May 15 2003 %C A057079 Hexaperiodic sequence identical to its third differences. - _Paul Curtz_, Dec 13 2007 %C A057079 a(n+1) is the Hankel transform of A001700(n+1)-A001700(n). - _Paul Barry_, Apr 21 2009 %C A057079 Non-simple continued fraction expansion of 1 = 1+1/(2+1/(1+1/(-1+...))). - _R. J. Mathar_, Mar 08 2012 %C A057079 Pisano period lengths: 1, 3, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, ... - _R. J. Mathar_, Aug 10 2012 %C A057079 Alternating row sums of Riordan triangle A111125. - _Wolfdieter Lang_, Oct 18 2012 %C A057079 Periodic sequences of this type can be also calculated by a(n) = c + floor(q/(p^m-1)*p^n) mod p, where c is a constant, q is the number representing the periodic digit pattern and m is the period length. c, p and q can be calculated as follows: Let D be the array representing the number pattern to be repeated, m = size of D, max = maximum value of elements in D, min = minimum value of elements in D. Than c := min, p := max - min + 1 and q := p^m*sum_{i=1..m} (D(i)-min)/p^i. Example: D = (1, 2, 1, -1, -2, -1), c = -2, m = 6, p = 5 and q = 12276 for this sequence. - _Hieronymus Fischer_, Jan 04 2013 %H A057079 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 A057079 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=3. %H A057079 Tanya Khovanova, <a href="http://www.tanyakhovanova.com/RecursiveSequences/RecursiveSequences.html">Recursive Sequences</a> %H A057079 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1). %H A057079 <a href="/index/Rea#recur1">Index entries for recurrences a(n) = k*a(n - 1) +/- a(n - 2)</a> %H A057079 <a href="/index/Ch#Cheby">Index entries for sequences related to Chebyshev polynomials.</a> %F A057079 a(n) = S(n, 1) + S(n-1, 1) = S(2*n, sqrt(3)); S(n, x) := U(n, x/2), Chebyshev polynomials of 2nd kind, A049310. S(n, 1) = A010892(n). %F A057079 a(n) = 2*cos((n-1)*Pi/3) = a(n-1) - a(n-2) = -a(n-3) = a(n-6) = (A022003(n+1)+1)*(-1)^floor(n/3). Unsigned a(n) = 4 - a(n-1) - a(n-2). - _Henry Bottomley_, Mar 29 2001 %F A057079 a(n) = (-1)^floor(n/3) + ((-1)^floor((n-1)/3) + (-1)^floor((n+1)/3))/2. - Mario Catalani (mario.catalani(AT)unito.it), Jan 07 2003 %F A057079 a(n) = (1/2 - sqrt(3)*i/2)^(n-1) + (1/2 + sqrt(3)*i/2)^(n-1) = cos(Pi*n/3) + sqrt(3)*sin(Pi*n/3). - _Paul Barry_, Mar 15 2004 %F A057079 The period 3 sequence (2, -1, -1, ...) has a(n) = 2*cos(2*Pi*n/3) = (-1/2 - sqrt(3)*i/2)^n + (-1/2 + sqrt(3)*i/2)^n. - _Paul Barry_, Mar 15 2004 %F A057079 Euler transform of length 6 sequence [2, -2, -1, 0, 0, 1]. - _Michael Somos_, Jul 14 2006 %F A057079 G.f.: (1 + x) / (1 - x + x^2) = (1 - x^2)^2 * (1 - x^3) / ((1 - x)^2 * (1 - x^6)). a(n) = a(2-n) for all n in Z. - _Michael Somos_, Jul 14 2006 %F A057079 a(n) = A033999(A002264(n))*(A000035(A010872(n))+1). - _Hieronymus Fischer_, Jun 20 2007 %F A057079 a(n) = (3*A033999(A002264(n)) - A033999(n))/2. - _Hieronymus Fischer_, Jun 20 2007 %F A057079 a(n) = (-1)^floor(n/3)*((n mod 3) mod 2 + 1). - _Hieronymus Fischer_, Jun 20 2007 %F A057079 a(n) = (3*(-1)^floor(n/3) - (-1)^n)/2. - _Hieronymus Fischer_, Jun 20 2007 %F A057079 a(n) = (-1)^((n-1)/3) + (-1)^((1-n)/3). - _Jaume Oliver Lafont_, May 13 2010 %F A057079 E.g.f.: E(x) = S(0), S(k) = 1 + 2*x/(6*k+1 - x*(6*k+1)/(4*(3*k+1) + x + 4*x*(3*k+1)/(6*k + 3 - x - x*(6*k+3)/(3*k + 2 + x - x*(3*k+2)/(12*k + 10 + x - x*(12*k+10)/(x - (6*k+6)/S(k+1))))))); (continued fraction). - _Sergei N. Gladkovskii_, Dec 14 2011 %F A057079 a(n) = -2 + floor((281/819)*10^(n+1)) mod 10. - _Hieronymus Fischer_, Jan 04 2013 %F A057079 a(n) = -2 + floor((11/14)*5^(n+1)) mod 5. - _Hieronymus Fischer_, Jan 04 2013 %F A057079 a(n) = A010892(n) + A010892(n-1). %F A057079 a(n) = ( (1+i*sqrt(3))^(n-1) + (1-i*sqrt(3))^(n-1) )/2^(n-1), where i=sqrt(-1). - _Bruno Berselli_, Dec 01 2014 %F A057079 a(n) = 2*sin((2n+1)*Pi/6). - _Wesley Ivan Hurt_, Apr 04 2015 %F A057079 a(n) = hypergeom([-n/2-2, -n/2-5/2], [-n-4], 4). - _Peter Luschny_, Dec 17 2016 %F A057079 G.f.: 1 / (1 - 2*x / (1 + 3*x / (2 - x))). - _Michael Somos_, Dec 29 2016 %F A057079 a(n) = (2*n+1)*(Sum_{k=0..n} ((-1)^k/(2*k+1))*binomial(n+k,2*k)) for n >= 0. - _Werner Schulte_, Jul 10 2017 %F A057079 Sum_{n>=0} (a(n)/(2*n+1))*x^(2*n+1) = arctan(x/(1-x^2)) for -1 < x < 1. - _Werner Schulte_, Jul 10 2017 %F A057079 E.g.f.: exp(x/2)*(sqrt(3)*cos(sqrt(3)*x/2) + 3*sin(sqrt(3)*x/2))/sqrt(3). - _Stefano Spezia_, Aug 04 2025 %e A057079 G.f. = 1 + 2*x + x^2 - x^3 - 2*x^4 - x^5 + x^6 + 2*x^7 + x^8 - x^9 - 2*x^10 + x^11 + ... %p A057079 A057079:=n->[1, 2, 1, -1, -2, -1][(n mod 6)+1]: seq(A057079(n), n=0..100); # _Wesley Ivan Hurt_, Mar 10 2015 %t A057079 a[n_] := {1, 2, 1, -1, -2, -1}[[Mod[n, 6] + 1]]; Array[a, 100, 0] (* _Jean-François Alcover_, Jul 05 2013 *) %t A057079 CoefficientList[Series[(1 + x)/(1 - x + x^2), {x, 0, 71}], x] (* _Michael De Vlieger_, Jul 10 2017 *) %t A057079 PadRight[{},100,{1,2,1,-1,-2,-1}] (* _Harvey P. Dale_, Nov 11 2024 *) %o A057079 (PARI) {a(n) = [1, 2, 1, -1, -2, -1][n%6 + 1]}; /* _Michael Somos_, Jul 14 2006 */ %o A057079 (PARI) {a(n) = if( n<0, n = 2-n); polcoeff( (1 + x) / (1 - x + x^2) + x * O(x^n), n)}; /* _Michael Somos_, Jul 14 2006 */ %o A057079 (PARI) a(n)=2^(n%3%2)*(-1)^(n\3) \\ _Tani Akinari_, Aug 15 2013 %Y A057079 Cf. A049310. Apart from signs, same as A061347. %Y A057079 Cf. A002264, A010872. %K A057079 easy,sign %O A057079 0,2 %A A057079 _Wolfdieter Lang_, Aug 04 2000