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 A168361 #25 Sep 08 2022 08:45:49 %S A168361 2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2, %T A168361 -1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1, %U A168361 2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1,2,-1 %N A168361 Period 2: repeat 2, -1. %C A168361 Interleaving of A007395 and -A000012. %C A168361 Binomial transform of 2 followed by a signed version of A007283; also binomial transform of a signed version of A042950. %C A168361 Second binomial transform of a signed version of A007051 without initial term 1. %C A168361 Inverse binomial transform of 2 followed by A000079. %C A168361 A028242 without first two terms gives partial sums. %H A168361 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,1). %F A168361 a(n) = (1 - 3*(-1)^n)/2. %F A168361 a(n) = -a(n-1) + 1 for n > 1; a(1) = 2. %F A168361 a(n) = a(n-2) for n > 2; a(1) = 2, a(2) = -1. %F A168361 a(n+1) - a(n) = 3*(-1)^n. %F A168361 G.f.: x*(2 - x)/((1-x)*(1+x)). %F A168361 E.g.f.: (1/2)*(-1 + exp(x))*(3 + exp(x))*exp(-x). - _G. C. Greubel_, Jul 19 2016 %t A168361 PadRight[{},120,{2,-1}] (* _Harvey P. Dale_, Jan 04 2015 *) %t A168361 Table[(1 - 3 (-1)^n)/2, {n, 120}] (* or *) %t A168361 Rest@ CoefficientList[Series[x (2 - x)/((1 - x) (1 + x)), {x, 0, 120}], x] (* _Michael De Vlieger_, Jul 19 2016 *) %o A168361 (Magma) &cat[ [2, -1]: n in [1..42] ]; %o A168361 [ n eq 1 select 2 else -Self(n-1)+1: n in [1..84] ]; %o A168361 (PARI) a(n)=2-n%2*3 \\ _Charles R Greathouse IV_, Jul 13 2016 %o A168361 (Magma) &cat[[2,-1]^^40]; // _Vincenzo Librandi_, Jul 20 2016 %Y A168361 Cf. A168330 (repeat 3, -2), A007395 (all 2's sequence), A000012 (all 1's sequence), (A007283 3*2^n), A042950, A007051 ((3^n+1)/2), A000079 (powers of 2), A028242 (follow n+1 by n). %K A168361 sign,easy %O A168361 1,1 %A A168361 _Klaus Brockhaus_, Nov 23 2009 %E A168361 G.f. adapted to the offset by _Bruno Berselli_, Apr 01 2011