A127904 Smallest m such that A008687(m) = n.
0, 1, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825, 2147483649
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (3,-2).
Programs
-
Magma
m:=30; R
:=PowerSeriesRing(Rationals(), m); [0] cat Coefficients(R!(x*(1-2*x^2)/((1-x)*(1-2*x)))); // G. C. Greubel, Apr 30 2018 -
Mathematica
Join[{0,1},LinearRecurrence[{3,-2},{3,5},40]] (* or *) Join[{0,1},2^Range[ 40]+1] (* Harvey P. Dale, Jan 16 2013 *)
-
PARI
x='x+O('x^30); concat([0], Vec(x*(1-2*x^2)/((1-x)*(1-2*x)))) \\ G. C. Greubel, Apr 30 2018
-
PARI
a(n) = if(n<2,n,2^(n-1)+1); \\ Altug Alkan, May 01 2018
Formula
For n>1, a(n) = A000051(n-1) = 2^(n-1)+1.
From Bruno Berselli, Sep 01 2011: (Start)
G.f.: x*(1-2*x^2)/((1-x)*(1-2*x)).
a(n) = 3*a(n-1) -2*a(n-2) for n=2 and n>3. (End)
Comments