The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A168361 Period 2: repeat 2, -1. 6
 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, 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, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1, 2, -1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 COMMENTS Interleaving of A007395 and -A000012. Binomial transform of 2 followed by a signed version of A007283; also binomial transform of a signed version of A042950. Second binomial transform of a signed version of A007051 without initial term 1. Inverse binomial transform of 2 followed by A000079. A028242 without first two terms gives partial sums. LINKS Index entries for linear recurrences with constant coefficients, signature (0,1). FORMULA a(n) = (1 - 3*(-1)^n)/2. a(n) = -a(n-1) + 1 for n > 1; a(1) = 2. a(n) = a(n-2) for n > 2; a(1) = 2, a(2) = -1. a(n+1) - a(n) = 3*(-1)^n. G.f.: x*(2 - x)/((1-x)*(1+x)). E.g.f.: (1/2)*(-1 + exp(x))*(3 + exp(x))*exp(-x). - G. C. Greubel, Jul 19 2016 MATHEMATICA PadRight[{}, 120, {2, -1}] (* Harvey P. Dale, Jan 04 2015 *) Table[(1 - 3 (-1)^n)/2, {n, 120}] (* or *) Rest@ CoefficientList[Series[x (2 - x)/((1 - x) (1 + x)), {x, 0, 120}], x] (* Michael De Vlieger, Jul 19 2016 *) PROG (MAGMA) &cat[ [2, -1]: n in [1..42] ]; [ n eq 1 select 2 else -Self(n-1)+1: n in [1..84] ]; (PARI) a(n)=2-n%2*3 \\ Charles R Greathouse IV, Jul 13 2016 (MAGMA) &cat[[2, -1]^^40]; // Vincenzo Librandi, Jul 20 2016 CROSSREFS 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). Sequence in context: A327767 A228826 A288699 * A107393 A000034 A040001 Adjacent sequences:  A168358 A168359 A168360 * A168362 A168363 A168364 KEYWORD sign,easy AUTHOR Klaus Brockhaus, Nov 23 2009 EXTENSIONS G.f. adapted to the offset by Bruno Berselli, Apr 01 2011 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 17 16:00 EDT 2021. Contains 347478 sequences. (Running on oeis4.)