OFFSET
0,3
MAPLE
a:=proc(n) if n=0 or n=1 then n elif n mod 2 = 0 then 3*a(n-1) else 3*a(n-1)-2*a((n-3)/2) fi end: seq(a(n), n=0..31); - Emeric Deutsch, May 19 2007
MATHEMATICA
a[0] = 0; a[1] = 1; 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 *)
PROG
(PARI) {m=26; v=vector(m+1); v[1]=0; v[2]=1; 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 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Curtz, May 16 2007
EXTENSIONS
STATUS
approved