OFFSET
0,6
COMMENTS
Inspired by A002487.
Alternatively, a(0) = 0, a(1) = 1; for n >= 1, a(2*n) = a(2*n-1) - a(2*n-2), a(2*n+1) = a(2*n) - a(n). Note that if b(0) = 0, b(1) = 1; for n >= 1, b(2*n) = b(2*n-1) - b(n), b(2*n+1) = b(2*n) - b(2*n-1), then b(n) + A213369(n+1) = 0 for all n >= 1.
The main block structure of this sequence is described by A020714.
LINKS
Altug Alkan, Table of n, a(n) for n = 0..20480
Altug Alkan, A scatterplot of a(n) for n <= 5*2^12
FORMULA
a(5*2^k-2) = 0 for all k >= 0.
MATHEMATICA
a[0]=a[3]=0; a[1]=a[2]=1; a[n_] := a[n] = If[EvenQ[n], -a[n/2-1], -a[(n-1)/2 - 1] - a[(n-1)/2]]; Array[a, 101, 0] (* Giovanni Resta, Aug 27 2018 *)
PROG
(PARI) a = vector(100); print1(0", "); for(k=1, #a, print1 (a[k]=if(k<=2, 1, my (n=k\2); if (k%2==0, -a[n-1], a[2*n]-a[n]))", "));
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Altug Alkan, Aug 19 2018
STATUS
approved