%I #47 Sep 08 2022 08:45:13
%S 0,2,7,18,41,88,183,374,757,1524,3059,6130,12273,24560,49135,98286,
%T 196589,393196,786411,1572842,3145705,6291432,12582887,25165798,
%U 50331621,100663268,201326563,402653154,805306337,1610612704,3221225439
%N a(n+3) = 3*a(n+2) - 2*a(n+1) + 1 with a(0)=0, a(1)=2.
%C A sequence generated from a Bell difference row matrix, companion to A095150.
%C A095150 uses the same recursion rule but the multiplier [1 1 1] instead of [1 0 0].
%C For n>0, (a(n)) is row 2 of the convolution array A213568. - _Clark Kimberling_, Jun 20 2012
%C For n>0, (a(n)) is row 2 of the convolution array A213568. - _Clark Kimberling_, Jun 20 2012
%H G. C. Greubel, <a href="/A095151/b095151.txt">Table of n, a(n) for n = 0..1000</a>
%H Péter Burcsi, Gabriele Fici, Zsuzsanna Lipták, Rajeev Raman, Joe Sawada, <a href="https://arxiv.org/abs/2003.03222">Generating a Gray code for prefix normal words in amortized polylogarithmic time per word</a>, arXiv:2003.03222 [cs.DS], 2020.
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (4,-5,2).
%F 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)].
%F 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
%F From _Colin Barker_, Apr 23 2012: (Start)
%F a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3).
%F G.f.: x*(2-x)/((1-x)^2*(1-2*x)). (End)
%F a(n) = A125128(n) + A000225(n). - _Miquel Cerda_, Aug 07 2016
%F a(n) = 2*A125128(n) - A000325(n) + 1. - _Miquel Cerda_, Aug 12 2016
%F a(n) = A125128(n) + A000325(n) + n - 1. - _Miquel Cerda_, Aug 27 2016
%F E.g.f.: 3*exp(2*x) - (3+x)*exp(x). - _G. C. Greubel_, Jul 26 2019
%F Let Prod_{i=0..n-1} (1+x^{2^i}+x^{2*2^i}) =
%F Sum_{j=0..d} b_j x^j, where d=2^{n+1}-2. Then
%F a(n)=Sum_{j=0..d-1} b_j/b_{j+1} (proved). - R. P. Stanley, Aug 27 2019
%e a(6) = 183 = 3*88 -2*41 + 1.
%e a(4) = 41 since M^4 * [1 0 0] = [1 4 41].
%p a[0]:=0:a[1]:=0:for n from 2 to 50 do a[n]:=2*a[n-1]+n od: seq(a[n], n=1..31); # _Zerinvary Lajos_, Feb 22 2008
%t a[n_] := (MatrixPower[{{1, 0, 0}, {1, 1, 0}, {2, 1, 2}}, n].{{1}, {0}, {0}})[[3, 1]]; Table[ a[n], {n, 30}] (* _Robert G. Wilson v_, Jun 05 2004 *)
%t Table[3*2^n -(n+3), {n,0,30}] (* _G. C. Greubel_, Jul 26 2019 *)
%o (PARI) vector(30, n, n--; 3*2^n -(n+3)) \\ _G. C. Greubel_, Jul 26 2019
%o (Magma) [3*2^n -(n+3): n in [0..30]]; // _G. C. Greubel_, Jul 26 2019
%o (Sage) [3*2^n -(n+3) for n in (0..30)] # _G. C. Greubel_, Jul 26 2019
%o (GAP) List([0..30], n-> 3*2^n -(n+3)); # _G. C. Greubel_, Jul 26 2019
%Y Cf. A000110, A011971, A095149, A095150.
%K nonn,easy
%O 0,2
%A _Gary W. Adamson_, May 30 2004
%E Edited by _Robert G. Wilson v_, Jun 05 2004