OFFSET
0,2
COMMENTS
For 2*2^k-2 <= n <= 3*2^k-1, a(n) alternates: 2^floor(k/2) if n is even, A029744(k+2) if n is odd. - Robert Israel, Nov 08 2016
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
MAPLE
A[0]:= 1: A[1]:= 2:
for n from 1 to 100 do
A[2*n]:= abs(A[n]-A[n-1]);
A[2*n+1]:= A[n]+A[n-1];
od:
seq(A[n], n=0..201); # Robert Israel, Nov 08 2016
MATHEMATICA
a[0]=1; a[1]=2; a[n_]:=If[EvenQ[n], Abs[a[n/2]-a[n/2-1]], a[(n-1)/2]+a[(n-3)/2]]; Array[a, 95, 0] (* Stefano Spezia, Apr 04 2024 *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
John W. Layman, Oct 14 2002
STATUS
approved