A126646 a(n) = 2^(n+1) - 1.
1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647
Offset: 0
Examples
a(8) = 2^9 - 1 = 511.
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Milan Janjic, Enumerative Formulas for Some Functions on Finite Sets
- Jerry Metzger and Thomas Richards, A Prisoner Problem Variation, Journal of Integer Sequences, Vol. 18 (2015), Article 15.2.7.
- Wikipedia, Simplex Elements (see last column of table).
- Index entries for linear recurrences with constant coefficients, signature (3,-2).
Crossrefs
Programs
-
Haskell
a126646 = (subtract 1) . (2 ^) . (+ 1) a126646_list = iterate ((+ 1) . (* 2)) 1 -- Reinhard Zumkeller, Sep 17 2015
-
Magma
[2^(n+1)-1: n in [0.. 35]]; // Vincenzo Librandi, Aug 20 2015
-
Maple
A126646:=n->2*2^n-1; seq(A126646(n), n=0..50); # Wesley Ivan Hurt, Dec 02 2013
-
Mathematica
Table[2^(n+1) - 1, {n, 0, 50}] (* Wesley Ivan Hurt, Dec 02 2013 *) LinearRecurrence[{3,-2},{1,3},40] (* Harvey P. Dale, Mar 23 2018 *)
-
PARI
first(m)=vector(m,i,i--;2^(i+1)-1) /* Anders Hellström, Aug 19 2015 */
-
Python
def A126646(n): return (1<
Chai Wah Wu, Mar 18 2024 -
Sage
[2^(n+1) -1 for n in (0..50)] # G. C. Greubel, Mar 31 2021
Formula
a(n-1)^2 + a(n) = a(2n) + 1, a square. - Vincenzo Librandi and Ralf Stephan, Nov 23 2010
G.f.: 1/ ( (1-2*x)*(1-x) ). - R. J. Mathar, Dec 02 2013
a(n) = 3*a(n-1) - 2*a(n-2), n > 1. - Wesley Ivan Hurt, Aug 21 2015
E.g.f.: 2*exp(2*x) - exp(x). - G. C. Greubel, Mar 31 2021
Comments