login
A318163
a(0) = a(3) = 0, a(1) = a(2) = 1; for n >= 2, a(2*n) = -a(n-1) and a(2*n+1) = -a(n-1)-a(n).
1
0, 1, 1, 0, -1, -2, -1, -1, 0, 1, 1, 3, 2, 3, 1, 2, 1, 1, 0, -1, -1, -2, -1, -4, -3, -5, -2, -5, -3, -4, -1, -3, -2, -3, -1, -2, -1, -1, 0, 1, 1, 2, 1, 3, 2, 3, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1, 0, -1, -1, -2, -1, -3, -2, -3, -1, -4, -3, -5, -2, -5, -3, -4, -1, -6, -5, -9, -4, -11, -7
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.
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