This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A007679 If n mod 4 = 0 then 2^(n-1)+1 elif n mod 4 = 2 then 2^(n-1)-1 else 2^(n-1). (Formerly M3359) 3
 1, 1, 4, 9, 16, 31, 64, 129, 256, 511, 1024, 2049, 4096, 8191, 16384, 32769, 65536, 131071, 262144, 524289, 1048576, 2097151, 4194304, 8388609, 16777216, 33554431, 67108864, 134217729, 268435456, 536870911 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 REFERENCES M. E. Larsen, Summa Summarum, A. K. Peters, Wellesley, MA, 2007; see p. 37. [From N. J. A. Sloane, Jan 29 2009] N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). LINKS Vincenzo Librandi, Table of n, a(n) for n = 1..1000 I. Nemes et al., How to do Monthly problems with your computer, Amer. Math. Monthly, 104 (1997), 505-519. Index entries for linear recurrences with constant coefficients, signature (2,-1,2). FORMULA a(n) = 2^(n-1) + cos(n*Pi/2). a(n) = sum(2^k*C(n-k, 2k)*n/(n-k), k=0..floor(n/3)). a(n) = A007909(n) + A007910(n). a(n) = ((-i)^n+i^n+2^n)/2, where i=sqrt(-1). a(n) = 2*a(n-1)-a(n-2)+2*a(n-3). G.f.: x*(1-x+3*x^2)/((1-2*x)*(1+x^2)). [Colin Barker, May 08 2012] MAPLE f:=n->2^(n-1)+cos(Pi*n/2); MATHEMATICA CoefficientList[Series[(1-x+3*x^2)/((1-2*x)*(1+x^2)), {x, 0, 30}], x] (* Vincenzo Librandi, May 09 2012 *) Table[Which[Mod[n, 4]==0, 2^(n-1)+1, Mod[n, 4]==2, 2^(n-1)-1, True, 2^(n-1)], {n, 30}] (* or *) LinearRecurrence[{2, -1, 2}, {1, 1, 4}, 30] (* Harvey P. Dale, May 01 2018 *) PROG (MAGMA) I:=[1, 1, 4]; [n le 3 select I[n] else 2*Self(n-1)-Self(n-2)+2*Self(n-3): n in [1..40]]; // Vincenzo Librandi, May 09 2012 CROSSREFS Sequence in context: A138992 A199936 A281904 * A239870 A068037 A167188 Adjacent sequences:  A007676 A007677 A007678 * A007680 A007681 A007682 KEYWORD nonn,easy AUTHOR N. J. A. Sloane, R. K. Guy, Simon Plouffe. 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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified August 21 13:31 EDT 2018. Contains 313954 sequences. (Running on oeis4.)