login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A083416 Add 1, double, add 1, double, etc. 7
1, 2, 4, 5, 10, 11, 22, 23, 46, 47, 94, 95, 190, 191, 382, 383, 766, 767, 1534, 1535, 3070, 3071, 6142, 6143, 12286, 12287, 24574, 24575, 49150, 49151, 98302, 98303, 196606, 196607, 393214, 393215, 786430, 786431, 1572862, 1572863 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 1..5000

Index entries for linear recurrences with constant coefficients, signature (0,3,0,-2).

FORMULA

G.f.: x*(1+2*x+x^2-x^3)/(1-x^2)/(1-2*x^2).

a(2*n) = 3*2^(n-1)-1, a(2*n+1) = 3*2^n-2.

a(n) = 3*2^((2*n-(-1)^n-3)/4)+((-1)^n-3)/2. - Bruno Berselli, Feb 17 2011

For n > 1: a(n) = (1 + n mod 2) * a(n-1) + 1 - n mod 2. - Reinhard Zumkeller, Feb 27 2012

a(2n+1) = A033484(n), a(2n) = A153893(n). - Philippe Deléham, Apr 14 2013

MAPLE

A083416 := proc(n) if type(n, 'even') then 3*2^(n/2-1)-1 ; else 3*2^((n-1)/2)-2 ; end if; end proc: # R. J. Mathar, Feb 16 2011

MATHEMATICA

a=0; b=0; lst={a, b}; Do[z=a+b+1; AppendTo[lst, z]; a=b; b=z; z=b+1; AppendTo[lst, z]; a=b; b=z, {n, 50}]; lst (* Vladimir Joseph Stephan Orlovsky, Feb 16 2010 *)

LinearRecurrence[{0, 3, 0, -2}, {1, 2, 4, 5}, 40] (* Harvey P. Dale, Nov 18 2014 *)

PROG

(MAGMA) [Floor(3*2^((2*n-(-1)^n-3)/4)+((-1)^n-3)/2): n in [1..50]]; // Vincenzo Librandi, Aug 17 2011

(Haskell)

a083416 n = a083416_list !! (n-1)

a083416_list = 1 : f 2 1 where

   f x y = z : f (x+1) z where z = (1 + x `mod` 2) * y + 1 - x `mod` 2

-- Reinhard Zumkeller, Feb 27 2012

CROSSREFS

a(n) = A081026(n+1)-1.

Cf. A075427. - Robert Ferreol, Feb 16 2011

Sequence in context: A128216 A080735 A091856 * A022770 A141481 A241268

Adjacent sequences:  A083413 A083414 A083415 * A083417 A083418 A083419

KEYWORD

easy,nonn

AUTHOR

N. J. A. Sloane, Jun 10 2003

EXTENSIONS

More terms from Donald Sampson (marsquo(AT)hotmail.com), Dec 04 2003

Corrected by T. D. Noe, Nov 02 2006

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.

License Agreements, Terms of Use, Privacy Policy .

Last modified June 24 08:22 EDT 2017. Contains 288697 sequences.