The dragon Curve sequence The dragon curve sequence (or the regular paper folding sequence) is a binary sequence.  a(n) is given by negation of the bit left of the least significant 1 of n.  For example to calculate a(2136) we first convert to binary:

100001011000


We find our least significant bit

100001011000
        ^


Take the bit to its left

100001011000
       ^


And return its negation

0


Task

Given a positive integer as input, output a(n). (You may output by integer or by boolean).  You should aim to make your code as small as possible as measured by bytes.

Test Cases

Here are the first 100 entries in order

1 1 0 1 1 0 0 1 1 1 0 0 1 0 0 1 1 1 0 1 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 1 0 0 1 1 1 0 0 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 1 0 0 1 1 1 0 0 1 0 0 1 1 1 0 1 1 0 0 0 1 1 0 0 1 0 0 0 1 1 0 1
Mathematica 25 Bytes

1/2+JacobiSymbol[-1,#]/2&amp;


Other ways of doing this:

56 bytes

(v:=1-IntegerDigits[#,2,i][[1]];For[i=1,v&gt;0,i++];i++;v)&amp;


58 bytes

1-Nest[Join[#,{0},Reverse[1-#]]&amp;,{0},Floor@Log[2,#]][[#]]&amp;