%I #62 Oct 30 2023 15:34:05
%S 1,3,8,17,35,71,143,287,575,1151,2303,4607,9215,18431,36863,73727,
%T 147455,294911,589823,1179647,2359295,4718591,9437183,18874367,
%U 37748735,75497471,150994943,301989887,603979775,1207959551,2415919103
%N G.f.: (1+x^2-x^3)/((1-x)(1-2*x)).
%H Vincenzo Librandi, <a href="/A052996/b052996.txt">Table of n, a(n) for n = 0..1000</a>
%H INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=1074">Encyclopedia of Combinatorial Structures 1074</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2).
%F Recurrence: {-2*a(n)+a(n+1)-1=0, a(0)=1, a(1)=3, a(2)=8}.
%F a(n) = 9*2^(n-2) - 1 for n > 1. - _Brad Clardy_, Sep 23 2011
%p spec := [S, {S=Prod(Union(Prod(Z,Z), Sequence(Z)), Sequence(Union(Z,Z)))}, unlabeled ]: seq(combstruct[count](spec, size=n), n=0..20);
%t a=8; lst={1, 3, a}; k=9; Do[a+=k; AppendTo[lst, a]; k+=k, {n, 0, 5!}]; lst (* _Vladimir Joseph Stephan Orlovsky_, Dec 17 2008 *)
%t a[0] := 1; a[1] := 3; a[2] := 8; a[n_] := 2*a[n - 1] + 1; Table[a[n], {n, 0, 12}] (* _L. Edson Jeffery_, Dec 18 2014 *)
%t CoefficientList[ Series[(1 + x^2 - x^3)/((1 - x) (1 - 2 x)), {x, 0, 30}], x] (* _Robert G. Wilson v_, Jul 29 2015 *
%t LinearRecurrence[{3,-2},{1,3,8,17},40] (* _Harvey P. Dale_, Feb 11 2018 *)
%o (Magma) [Floor(9*2^(n-2) - 1): n in [0..40]]; // _Vincenzo Librandi_, Sep 24 2011
%o (PARI) Vec((1+x^2-x^3)/((1-x)*(1-2*x)) + O(x^50)) \\ _Michel Marcus_, Jul 30 2015
%Y Cf. A050524 (primes of this sequence).
%K easy,nonn
%O 0,2
%A encyclopedia(AT)pommard.inria.fr, Jan 25 2000
%E More terms from _James A. Sellers_, Jun 06 2000
|