A095151 a(n+3) = 3*a(n+2) - 2*a(n+1) + 1 with a(0)=0, a(1)=2.
0, 2, 7, 18, 41, 88, 183, 374, 757, 1524, 3059, 6130, 12273, 24560, 49135, 98286, 196589, 393196, 786411, 1572842, 3145705, 6291432, 12582887, 25165798, 50331621, 100663268, 201326563, 402653154, 805306337, 1610612704, 3221225439
Offset: 0
Examples
a(6) = 183 = 3*88 -2*41 + 1.
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Péter Burcsi, Gabriele Fici, Zsuzsanna Lipták, Rajeev Raman, and Joe Sawada, Generating a Gray code for prefix normal words in amortized polylogarithmic time per word, arXiv:2003.03222 [cs.DS], 2020.
- Index entries for linear recurrences with constant coefficients, signature (4,-5,2).
Programs
-
GAP
List([0..30], n-> 3*2^n -(n+3)); # G. C. Greubel, Jul 26 2019
-
Magma
[3*2^n -(n+3): n in [0..30]]; // G. C. Greubel, Jul 26 2019
-
Mathematica
Table[3*2^n -(n+3), {n,0,30}] (* G. C. Greubel, Jul 26 2019 *)
-
PARI
vector(30, n, n--; 3*2^n -(n+3)) \\ G. C. Greubel, Jul 26 2019
-
Sage
[3*2^n -(n+3) for n in (0..30)] # G. C. Greubel, Jul 26 2019
Formula
Let M = a 3 X 3 matrix having Bell triangle difference terms (A095149 is composed of differences of the Bell triangle A011971): (fill in the 3 X 3 matrix with zeros): [1 0 0 / 1 1 0 / 2 1 2] = M. Then M^n * [1 0 0] = [1 n a(n)]. E.g. a(4) = 41 since M^4 * [1 0 0] = [1 4 41].
a(n) = 3*2^n -(n+3) = 2*a(n-1) + n +1 = A000295(n+2) - A000079(n). For n>0, a(n) = A077802(n). - Henry Bottomley, Oct 25 2004
From Colin Barker, Apr 23 2012: (Start)
a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3).
G.f.: x*(2-x)/((1-x)^2*(1-2*x)). (End)
E.g.f.: 3*exp(2*x) - (3+x)*exp(x). - G. C. Greubel, Jul 26 2019
Let Prod_{i=0..n-1} (1+x^{2^i}+x^{2*2^i}) = Sum_{j=0..d} b_j x^j, where d=2^{n+1}-2. Then a(n) = Sum_{j=0..d-1} b_j/b_{j+1} (proved). - Richard Stanley, Aug 27 2019
Extensions
Edited by Robert G. Wilson v, Jun 05 2004
Deleted a comment and file that were unrelated to this sequence. - N. J. A. Sloane, Aug 17 2025
Comments