login
a(0) = 1, a(1) = 2; for n > 0, a(2n) = 3a(2n-1), a(2n+1) = 3a(2n) - 2a(n-1).
2

%I #9 Feb 18 2019 02:45:39

%S 1,2,6,16,48,140,420,1248,3744,11200,33600,100704,302112,906056,

%T 2718168,8153664,24460992,73380480,220141440,660416832,1981250496,

%U 5943729088,17831187264,53493494592,160480483776,481441249920,1444323749760

%N a(0) = 1, a(1) = 2; for n > 0, a(2n) = 3a(2n-1), a(2n+1) = 3a(2n) - 2a(n-1).

%p a[0]:=1: a[1]:=2: for n from 2 to 30 do if n mod 2 = 0 then a[n]:=3*a[n-1] else a[n]:=3*a[n-1]-2*a[(n-3)/2] fi od: seq(a[n],n=0..30); # _Emeric Deutsch_, May 22 2007

%t a[0] = 1; a[1] = 2; a[n_] := If[OddQ@n, 3 a[n - 1] - 2 a[(n - 3)/2], 3 a[n - 1]]; Table[ a[n], {n, 0, 26}] (* _Robert G. Wilson v_ *)

%o (PARI) {m=26; v=vector(m+1); v[1]=1; v[2]=2; for(n=2, m, k=3*v[n]; if(n%2==1, k=k-2*v[(n-1)/2]); v[n+1]=k); print(v)} /* _Klaus Brockhaus_, May 20 2007 */

%Y Cf. A129770.

%K nonn

%O 0,2

%A _Paul Curtz_, May 16 2007

%E More terms from _Emeric Deutsch_, _Robert G. Wilson v_ and _Klaus Brockhaus_, May 16 2007