cp's OEIS Frontend

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.

A083416 Add 1, double, add 1, double, etc.

This page as a plain text file.
%I A083416 #51 Jul 11 2023 07:57:59
%S A083416 1,2,4,5,10,11,22,23,46,47,94,95,190,191,382,383,766,767,1534,1535,
%T A083416 3070,3071,6142,6143,12286,12287,24574,24575,49150,49151,98302,98303,
%U A083416 196606,196607,393214,393215,786430,786431,1572862,1572863,3145726,3145727,6291454
%N A083416 Add 1, double, add 1, double, etc.
%H A083416 Vincenzo Librandi, <a href="/A083416/b083416.txt">Table of n, a(n) for n = 1..5000</a>
%H A083416 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,3,0,-2).
%F A083416 G.f.: x*(1+2*x+x^2-x^3)/(1-x^2)/(1-2*x^2).
%F A083416 a(2*n) = 3*2^(n-1)-1, a(2*n+1) = 3*2^n-2.
%F A083416 a(n) = A081026(n+1)-1.
%F A083416 a(n) = 3*2^((2*n-(-1)^n-3)/4)+((-1)^n-3)/2. - _Bruno Berselli_, Feb 17 2011
%F A083416 For n > 1: a(n) = (1 + n mod 2) * a(n-1) + 1 - n mod 2. - _Reinhard Zumkeller_, Feb 27 2012
%F A083416 a(2n+1) = A033484(n), a(2n) = A153893(n). - _Philippe Deléham_, Apr 14 2013
%F A083416 E.g.f.: (3*cosh(sqrt(2)*x) - 4*sinh(x) + 3*sqrt(2)*sinh(sqrt(2)*x) - 2*cosh(x) - 1)/2. - _Stefano Spezia_, Jul 11 2023
%p A083416 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
%t A083416 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 *)
%t A083416 LinearRecurrence[{0,3,0,-2},{1,2,4,5},40] (* _Harvey P. Dale_, Nov 18 2014 *)
%o A083416 (Magma) [Floor(3*2^((2*n-(-1)^n-3)/4)+((-1)^n-3)/2): n in [1..50]]; // _Vincenzo Librandi_, Aug 17 2011
%o A083416 (Haskell)
%o A083416 a083416 n = a083416_list !! (n-1)
%o A083416 a083416_list = 1 : f 2 1 where
%o A083416    f x y = z : f (x+1) z where z = (1 + x `mod` 2) * y + 1 - x `mod` 2
%o A083416 -- _Reinhard Zumkeller_, Feb 27 2012
%Y A083416 Cf. A033484, A081026, A153893.
%K A083416 easy,nonn
%O A083416 1,2
%A A083416 _N. J. A. Sloane_, Jun 10 2003
%E A083416 More terms from Donald Sampson (marsquo(AT)hotmail.com), Dec 04 2003
%E A083416 Corrected by _T. D. Noe_, Nov 02 2006