OFFSET
0,3
COMMENTS
First differences of A102877, divided by 2.
LINKS
Robert Israel, Table of n, a(n) for n = 0..2095
FORMULA
From Robert Israel, Jun 30 2020: (Start)
a(2*n) = 2*a(2*n-1) + 3*a(2*n-2) - 2*a(n-2) for n >= 2.
a(2*n+1) = 2*a(2*n) + 3*a(2*n-1) for n >= 1.
G.f. g(z) = ((1/z - 1)*h(z) - 1/z)/2 where h(z) is the G.f. of A102877.
(3*z-1)*(z+1)*g(z) = 2*z^4*g(z^2)-z.
(End)
MAPLE
f:= proc(n) option remember;
if n::even then 2*procname(n-1)+3*procname(n-2)-2*procname(n/2-2)
else 2*procname(n-1)+3*procname(n-2)
fi
end proc:
f(0):= 0: f(1):= 1: f(2):= 2:
map(f, [$0..50]); # Robert Israel, Jun 30 2020
MATHEMATICA
a[0] := 1; a[1] := 1; a[n_] := If[EvenQ[n], 3*a[n - 1], 3*a[n - 1] - 2*a[(n - 3)/2]]; Table[(a[i + 1] - a[i])/2, {i, 1, 50}] (* Stefan Steinerberger, May 22 2007 *)
PROG
(PARI) {m=27; v=vector(m+1); v[1]=1; 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); w=vector(m, n, (v[n+1]-v[n])/2); print(w)} /* Klaus Brockhaus, May 20 2007 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Curtz, May 17 2007
EXTENSIONS
Edited and extended by Klaus Brockhaus and Stefan Steinerberger, May 20 2007
STATUS
approved