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.

A127904 Smallest m such that A008687(m) = n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Feb 05 2007

Keywords

Comments

A008687(a(n)) = n and A008687(m) < n for m < a(n).

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)