%I #23 Sep 08 2022 08:45:30
%S 2,5,9,16,31,63,128,257,513,1024,2047,4095,8192,16385,32769,65536,
%T 131071,262143,524288,1048577,2097153,4194304,8388607,16777215,
%U 33554432,67108865,134217729,268435456,536870911,1073741823,2147483648,4294967297,8589934593
%N Binomial transform of periodic sequence (2, 3, 1).
%C The second sequence of "less twisted numbers"; this sequence, A130750 and A130755 form a "suite en trio" (cf. reference, p. 130).
%C First differences of A130750, second differences of A130755.
%C Sequence equals its third differences:
%C 2.....5.....9....16....31....63...128...257...513..1024...
%C ...3.....4.....7....15....32....65...129...256...511...
%C ......1.....3.....8....17....33....64...127...255...
%C ..........2.....5.....9....16....31....63...128...
%D P. Curtz, Exercise Book, manuscript, 1995.
%H Colin Barker, <a href="/A130752/b130752.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,2).
%F G.f.: (2 - x) / ((1 - 2*x)*(1 - x + x^2)).
%F a(0) = 2; a(1) = 5; a(2) = 9; for n > 2, a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3).
%F a(n) = 2^(n+1) + A128834(n).
%F a(0) = 2; for n > 0, a(n) = 2*a(n-1) + A057079(n+1).
%F E.g.f.: 2*(sqrt(3)*exp(2*x) + sin(sqrt(3)*x/2)*exp(x/2))/sqrt(3). - _Ilya Gutkovskiy_, Jun 20 2016
%F a(n) = 2^(n+1) + (2*sin((Pi*n)/3))/sqrt(3). - _Colin Barker_, Jan 20 2017
%t a[n_] := 2^(n+1) + 2*Sin[n*Pi/3]/Sqrt[3]; Table[a[n], {n, 0, 30}] (* _Jean-François Alcover_, Aug 13 2012 *)
%t LinearRecurrence[{3,-3,2},{2,5,9},40] (* _Harvey P. Dale_, Jun 21 2017 *)
%o (Magma) m:=31; S:=[ [2, 3, 1][(n-1) mod 3 +1]: n in [1..m] ]; [ &+[ Binomial(i-1, k-1)*S[k]: k in [1..i] ]: i in [1..m] ]; /* _Klaus Brockhaus_, Aug 03 2007 */
%o (PARI) {m=31; v=vector(m); v[1]=2; v[2]=5; v[3]=9; for(n=4, m, v[n]=3*v[n-1]-3*v[n-2]+2*v[n-3]); v} \\ _Klaus Brockhaus_, Aug 03 2007
%o (PARI) {for(n=0, 30, print1(2^(n+1)+[0, 1, 1, 0, -1, -1][n%6+1], ","))} \\ _Klaus Brockhaus_, Aug 03 2007
%o (PARI) Vec((2-x) / ((1-2*x)*(1-x+x^2)) + O(x^40)) \\ _Colin Barker_, Jan 20 2017
%Y Cf. A010882, A130755 (first differences), A130750 (second differences).
%K nonn,easy
%O 0,1
%A _Paul Curtz_, Jul 13 2007
%E Edited and extended by _Klaus Brockhaus_, Aug 03 2007