[Question]
  [
If you express some positive integer in binary with no leading zeros and replace every `1` with a `(` and every `0` with a `)`, then will all the parentheses match?
In most cases they won't. For example, 9 is `1001` in binary, which becomes `())(`, where only the first two parentheses match.
But sometimes they will match. For example, 44 is `101100` in binary, which becomes `()(())`, where all the left parentheses have a matching right parenthesis.
Write a program or function that takes in a positive **base ten** integer and prints or returns a [truthy](https://codegolf.meta.stackexchange.com/a/2194/26997) value if the binary-parentheses version of the number has all matching parentheses. If it doesn't, print or return a [falsy](https://codegolf.meta.stackexchange.com/a/2194/26997) value. 
**The shortest code in bytes wins.**
[Related OEIS sequence.](https://oeis.org/A014486)
Truthy examples below 100:
```
2, 10, 12, 42, 44, 50, 52, 56
```
Falsy examples below 100:
```
1, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 45, 46, 47, 48, 49, 51, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
```
  
[Answer]
# Pyth, 10 bytes
```
!uscG`T.BQ
```
Try [this test suite](https://pyth.herokuapp.com/?code=%21uscG%60T.BQ&test_suite=1&test_suite_input=2%0A10%0A12%0A42%0A44%0A50%0A52%0A56%0A1%0A3%0A4%0A5%0A6%0A7%0A8%0A9%0A11%0A13%0A14%0A15%0A16%0A17%0A18%0A19%0A20%0A21%0A22%0A23%0A24%0A25%0A26%0A27%0A28%0A29%0A30%0A31%0A32%0A33%0A34%0A35%0A36%0A37%0A38%0A39%0A40%0A41%0A43%0A45%0A46%0A47%0A48%0A49%0A51%0A53%0A54%0A55%0A57%0A58%0A59%0A60%0A61%0A62%0A63%0A64%0A65%0A66%0A67%0A68%0A69%0A70%0A71%0A72%0A73%0A74%0A75%0A76%0A77%0A78%0A79%0A80%0A81%0A82%0A83%0A84%0A85%0A86%0A87%0A88%0A89%0A90%0A91%0A92%0A93%0A94%0A95%0A96%0A97%0A98%0A99&debug=0) in the Pyth Compiler.
### How it works
```
              (implicit) Store the evaluated input in Q.
       .BQ    Return the binary string representation of Q.
 u            Reduce w/base case; set G to .BQ and begin a loop:
     `T         Return str(10) = "10".
   cG           Split G (looping variable) at occurrences of "10".
  s             Join the pieces without separators.
              Set G to the returned string.
              If the value of G changed, repeat the loop.
              This will eventually result in either an empty string or a
              non-empty string without occurrences of "10".
!             Return (and print) the logical NOT of the resulting string.
```
[Answer]
# JavaScript (ES6), ~~55~~ ~~54~~ 51 bytes
```
n=>![...n.toString(d=2)].some(c=>(d+=c*2-1)<2)*d==2
```
Saved bytes thanks to [@V…™ ú·¥Ä…¥](https://codegolf.stackexchange.com/users/40695/v%C9%AA%CA%9C%E1%B4%80%C9%B4) and [@xsot](https://codegolf.stackexchange.com/users/45268/xsot)!
## Explanation
```
n=>
  ![...n.toString(    // convert the input to an array of binary digits
    d=2)]             // d = current depth (+2)
      .some(c=>       // iterate through the digits
        (d+=c*2-1)    // increment or decrement the parenthesis depth
          <2          // if the depth goes negative, return false
      )*
        d==2          // if we finished at a depth of 0, return true
```
[Answer]
# [TeaScript](https://github.com/vihanb/TeaScript), 9 [bytes](https://en.m.wikipedia.org/wiki/ISO/IEC_8859) ~~16 18 20 22 24~~
*Saved 2 bytes thanks to @ETHproductions*
```
!x√∑W(n,¬¢)
```
Woah. That's short. Uses @xnor's approach. This will use the recursive replace function (`W`) which will replace all `10` equal to `()` with nothing. If the string is blank it is balanced. 
---
Using a version of TeaScript made after this challenge was posted this could become **7 bytes:**
```
!x√∑W(n)
```
### Ungolfed
```
!xT(2)W(n,``)
```
### Explanation
```
!      // NOT, returns true if empty string, else false
 xT(2)   // To binary
 W(n,``) // n is 10, reclusive replaces 10 or (), with nothing.
```
[Answer]
# Python2, 87 bytes
```
try:exec"print 1,"+"".join(["],","["][int(c)]for c in bin(input())[2:])
except:print 0
```
A terrible implementation that abuses syntax errors.
[Answer]
## Python 2, 45 bytes
```
f=lambda n,i=1:i*n>0<f(n/2,i+(-1)**n)or n<i<2
```
A recursive function. Reads binary digits of `n` from the end, keeping a count `i` of the current nesting level of the parens. If it falls below `0`, reject. When we reach the start, checks whether the count is `0`.
Actually, we start the count at `i=1` to make it easy to check if it has fallen to `0`. The only terminal success case is `n==0` and `i==1`, checked with `n<i<2`. We force this check to happen if `n==0`, or if `i` falls to `0`, in which case it automatically fails.
feersum saved two bytes by restructuring the non-recursive cases with inequalities to short-circuit.
[Answer]
# CJam, 11 bytes
```
ri2b"}{"f=~
```
This is a tad unclean: For parenthifiable numbers, it will print one or more blocks. For non-parenthifiable numbers, it will crash without printing anything to STDOUT. If you try this online in the [CJam interpreter](http://cjam.aditsu.net/#code=ri2b%22%7D%7B%22f%3D~&input=56), keep in mind that it doesn't distinguish between STDOUT and STDERR.
Since non-empty/empty strings are truthy/falsy in CJam and printed output is always a string, it arguably complies with the rules. At the added cost of 3 more bytes, for a total of **14 bytes**, we can actually leaves a truthy or falsy *string* on the stack that will be printed:
```
Lri2b"}{"f=~]s
```
This still crashes for non-parenthifiable numbers, which is [allowed by default](https://codegolf.meta.stackexchange.com/a/4781).
### Test runs
```
$ cjam <(echo 'ri2b"}{"f=~') <<< 52 2>&-; echo
{{}{}}
$ cjam <(echo 'ri2b"}{"f=~') <<< 53 2>&-; echo
$ cjam <(echo 'ri2b"}{"f=~') <<< 54 2>&-; echo
$ cjam <(echo 'ri2b"}{"f=~') <<< 55 2>&-; echo
$ cjam <(echo 'ri2b"}{"f=~') <<< 56 2>&-; echo
{{{}}}
```
### How it works
```
ri          e# Read an integer from STDIN.
  2b        e# Push the array of its binary digits.
    "}{"f=  e# Replace 0's with }'s and 1's with {'s.
          ~ e# Evaluate the resulting string.
            e# If the brackets match, this pushes one or more blocks.
            e# If the brackets do not match, the interpreter crashes.
```
---
# CJam, 15 bytes
```
ri2bs_,{As/s}*!
```
Try [this fiddle](http://cjam.aditsu.net/#code=ri2bs_%2C%7BAs%2Fs%7D*!&input=56) in the CJam interpreter or [verify all test cases at once](http://cjam.aditsu.net/#code=q'%2C-~%5D%7B%0A%20%20Ri2bs_%2C%7BAs%2Fs%7D*!%0A%7DfR&input=2%2C%2010%2C%2012%2C%2042%2C%2044%2C%2050%2C%2052%2C%2056%0A1%2C%203%2C%204%2C%205%2C%206%2C%207%2C%208%2C%209%2C%2011%2C%2013%2C%2014%2C%2015%2C%2016%2C%2017%2C%2018%2C%2019%2C%2020%2C%2021%2C%2022%2C%2023%2C%2024%2C%2025%2C%2026%2C%2027%2C%2028%2C%2029%2C%2030%2C%2031%2C%2032%2C%2033%2C%2034%2C%2035%2C%2036%2C%2037%2C%2038%2C%2039%2C%2040%2C%2041%2C%2043%2C%2045%2C%2046%2C%2047%2C%2048%2C%2049%2C%2051%2C%2053%2C%2054%2C%2055%2C%2057%2C%2058%2C%2059%2C%2060%2C%2061%2C%2062%2C%2063%2C%2064%2C%2065%2C%2066%2C%2067%2C%2068%2C%2069%2C%2070%2C%2071%2C%2072%2C%2073%2C%2074%2C%2075%2C%2076%2C%2077%2C%2078%2C%2079%2C%2080%2C%2081%2C%2082%2C%2083%2C%2084%2C%2085%2C%2086%2C%2087%2C%2088%2C%2089%2C%2090%2C%2091%2C%2092%2C%2093%2C%2094%2C%2095%2C%2096%2C%2097%2C%2098%2C%2099).
### How it works
```
ri               Read an integer from STDIN.
  2b             Push the array of its binary digits.
    s            Cast to string.
     _,          Push the string's length.
       {    }*   Do that many times:
        As/        Split at occurrences of "10".
           s       Cast to string to flatten the array of strings.
              !  Push the logical NOT of the result.
```
[Answer]
## Python, 51 bytes
```
lambda n:eval("'0b'==bin(n)"+".replace('10','')"*n)
```
An anonymous function. Evaluates to an expression that looks like
```
'0b'==bin(n).replace('10','').replace('10','').replace('10','')...
```
Each replacement removes all `10`, which correspond to `()`. After all replacements have been made, the function returns whether what's left is just the binary prefix `0b`. It more than suffices to make `n` replacements, since a `k`-digit number takes at most `k/2` steps, and its value is most `2**k`.
[Answer]
# Ruby, 40
```
->i{n='%0b'%i;1while n.slice!'10';n<?0}
```
Simple string manipulation. Drops '10' until there is none left.
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-!`](https://codegolf.meta.stackexchange.com/a/14339/), 3 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
¬§eA
```
[Try it here](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LSE&code=pGVB&input=Mg)
```
¬§eA     :Implicit input of integer
¬§       :To binary string
 e      :Recursively replace
  A     :  10
        :Implicit output of logical NOT of final string (the empty string is falsey, all others are truthy)
```
[Answer]
# JavaScript ES5, ~~118~~ ~~87~~ ~~85~~ ~~82~~ 77 bytes
Interesting technique in my opinion. Minus a whole heck of a lot, thanks to @ETHproductions, and @NotthatCharles
```
function p(x){x=x.toString(2);while(/10/.test(x))x=x.replace(10,"");return!x}
```
## JavaScript ES6, ~~77~~ ~~57~~ ~~56~~ 54 bytes
-21 bytes to ETHproductions.
```
x=>[...x=x.toString(2)].map(_=>x=x.replace(10,""))&&!x
```
[Answer]
## [Seriously](https://github.com/Mego/Seriously), 17 bytes
```
,;2@¬°@`""9u$(√Ü`nY
```
Outputs `0` for false and `1` for true. [Try it online](http://seriouslylang.herokuapp.com/link/eyJjb2RlIjoiLDsyQMKhQGBcIlwiOXUkKMOGYG5ZIiwiaW5wdXQiOiI0NCJ9).
Explanation:
```
,      get value from stdin
;      dupe top of stack
2@¬°    pop a: push a string containing the binary representation of a (swapping to get order of operands correct)
@      swap top two elements to get original input back on top
`""9u$(√Ü` define a function:
  ""     push empty string
  9u$    push "10" (push 9, add 1, stringify)
  (      rotate stack right by 1
  √Ü      pop a,b,c: push a.replace(b,c) (replace all occurrences of "10" in the binary string with "")
n      pop f,a: call f a times
Y      pop a: push boolean negation of a (1 if a is falsey else 0)
```
[Answer]
# Japt, 23 bytes
**Japt** is a shortened version of **Ja**vaScri**pt**. [Interpreter](https://codegolf.stackexchange.com/a/62685/42545)
```
Us2 a e@+X?++P:P-- &&!P
```
This reminds me just how far Japt has yet to go compared to TeaScript. After revamping the interpreter in the next few days, I'd like to add in "shortcut" chars like V…™ ú·¥Ä…¥'s.
### How it works
```
       // Implicit: U = input number, P = empty string
Us2 a  // Convert U to base 2, then split the digits into an array.
e@     // Assert that every item X in this array returns truthily to:
 +X?   //  If X = 1,
 ++P   //   ++P. ++(empty string) returns 1.
 :P--  //  Otherwise, P--. Returns false if P is now -1.
&&!P   // Return the final result && !P (true if P is 0; false otherwise).
       // Implicit: output final expression
```
---
Shortly after this challenge, @V…™ ú·¥Ä…¥ (now known as @Downgoat) helped me implement a recursive-replace feature, like `W` in the TeaScript answer. This means that this challenge can now be done in just 5 bytes:
```
!¬¢eAs  // Implicit: U = input integer, A = 10
 ¬¢     // Convert U to binary.
  eAs  // Recursively remove instances of A.toString().
!      // Return the logical NOT of the result (true only for the empty string).
```
[Test it online!](http://ethproductions.github.io/japt/?v=1.4.4&code=IaJlQXM=&input=NTY=)
[Answer]
# Octave, 48 bytes
```
@(a)~((b=cumsum(2*dec2bin(a)-97))(end)|any(b<0))
```
[Answer]
## C++, 104 94 bytes
```
#include<iostream>
int n,c;int main(){for(std::cin>>n;n&c>=0;n>>=1)c+=n&1?-1:1;std::cout<<!c;}
```
Run with [this compiler](http://ideone.com), must specify standard input before running.
**Explanation**
* Declarations outside of main initialize to 0.
* Reading a decimal implicitly converts to binary, because this is a computer.
* We check bits/parenthesis *right to left* because of `n>>=1`.
* `c+=n&1?-1:1` keeps count of open parenthesis `)`.
* `n&c>=0` stops when only leading 0s remain or parenthesis close more than they open.
[Answer]
## Haskell, ~~49~~ 46 bytes
```
0#l=l==1
_#0=2<1
n#l=div n 2#(l+(-1)^n)
f=(#1)
```
Usage example: `f 13` -> `False`.
I'm keeping track of the nesting level `l` like many other answers. However, the "balanced" case is represented by `1`, so the "more-`)`-than-`(`" case is `0`.
PS: found the nesting level adjustment `l+(-1)^n` in xnor's [answer](https://codegolf.stackexchange.com/a/64018/34531).
[Answer]
# Python 2, ~~60~~ ~~57~~ ~~56~~ ~~55~~ ~~53~~ ~~52~~ ~~50~~ 49 bytes
```
n=input()
i=1
while i*n:i+=1|n%-2;n/=2
print i==1
```
Thanks to xnor for saving two bytes and feersum for bringing the final byte count to 49!
### Explanation
The input number, `n`, is processed from its least significant bit. `i` is a counter that keeps track of the number of 0's and 1's. Note that it is initialised to `1` to save a byte. The loop will abort before `n` reaches 0 if the number of 1's exceed the number of 0's (`i<=0`).
For the parentheses to be balanced, two conditions are required: 
* The number of 0's and 1's are equal (i.e. `i==1`)
* The number of 1's never exceeds the number of 0's during this process
(i.e the loop doesn't abort prematurely so `n==0`). Edit: I realised that this condition isn't necessary as `i` must be non-positive if `n!=0` so the previous condition is sufficient.
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), 8 bytes
```
k/œÑk/·πò«ë«í
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=&code=k%2F%CF%84k%2F%E1%B9%98%C7%91%C7%92&inputs=%5B2%2C%2010%2C%2012%2C%2042%2C%2044%2C%2050%2C%2052%2C%2056%2C%201%2C%203%2C%204%2C%205%2C%206%2C%207%2C%208%2C%209%2C%2011%2C%2013%2C%2014%2C%2015%2C%2016%2C%2017%2C%2018%2C%2019%2C%2020%2C%2021%2C%2022%2C%2023%2C%2024%2C%2025%2C%2026%2C%2027%2C%2028%2C%2029%2C%2030%2C%2031%2C%2032%2C%2033%2C%2034%2C%2035%2C%2036%2C%2037%2C%2038%2C%2039%2C%2040%2C%2041%2C%2043%2C%2045%2C%2046%2C%2047%2C%2048%2C%2049%2C%2051%2C%2053%2C%2054%2C%2055%2C%2057%2C%2058%2C%2059%2C%2060%2C%2061%2C%2062%2C%2063%2C%2064%2C%2065%2C%2066%2C%2067%2C%2068%2C%2069%2C%2070%2C%2071%2C%2072%2C%2073%2C%2074%2C%2075%2C%2076%2C%2077%2C%2078%2C%2079%2C%2080%2C%2081%2C%2082%2C%2083%2C%2084%2C%2085%2C%2086%2C%2087%2C%2088%2C%2089%2C%2090%2C%2091%2C%2092%2C%2093%2C%2094%2C%2095%2C%2096%2C%2097%2C%2098%2C%2099%2C%20170%2C%20172%2C%20178%2C%20180%2C%20184%2C%20202%2C%20204%2C%20210%2C%20212%2C%20216%2C%20226%2C%20228%2C%20232%2C%20240%2C%20682%2C%20684%2C%20690%2C%20692%2C%20696%2C%20714%2C%20716%2C%20722%2C%20724%2C%20728%2C%20738%2C%20740%2C%20744%2C%20752%2C%20810%2C%20812%2C%20818%2C%20820%2C%20824%2C%20842%2C%20844%2C%20850%2C%20852%2C%20856%2C%20866%2C%20868%2C%20872%2C%20880%5D&header=%CE%BB&footer=%3Bz)
Fortunately, Vyxal has a remove-substring-until-fixed-point builtin. Unfortunately, it only works on strings.
```
k/œÑ         Convert input to base "/\". (only string constant of length 2)
      «ë     Until it is no longer present as a substring, remove
   k/       "/\"
     ·πò      reversed.
       «í    Is the result empty?
```
Originally did some fancy dancing with stack rotations in Vyxal `r`, but it turned out the same length flagless to just use `k/` twice. I'm not having the best luck putting a solution together without replacement, but it doesn't seem like it could come out shorter.
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 42 bytes
```
TrueQ[And@@#~IntegerDigits~2//.1&&0:>1>0]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n6Zg@z@kqDQ1MNoxL8XBQbnOM68kNT21yCUzPbOkuM5IX1/PUE3NwMrO0M4gVu1/QFFmXkl0cGpOanJJdFBiXnqqg6GBgY5CWmzsfwA "Wolfram Language (Mathematica) ‚Äì Try It Online")
---
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 49 bytes
```
(#~IntegerDigits~2//.{x___,1,0,y___}:>{x,y})=={}&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n6Zg@19Duc4zryQ1PbXIJTM9s6S4zkhfX6@6Ij4@XsdQx0CnEsiotbKrrtCprNW0ta2uVfsfUJSZVxIdnJqTmlwSHZSYl57qYGhgoKOQFhv7HwA "Wolfram Language (Mathematica) ‚Äì Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), ~~[6](https://codegolf.stackexchange.com/revisions/260196/1)~~ 5 bytes
```
Œ†‚ÇÄ√∏o¬¨
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=1#WyJBIiwiIiwizqDigoDDuG/CrCIsIiIsIjJcbjEwXG4xMlxuNDJcbjQ0XG41MFxuNTJcbjU2XG4xXG4zIFxuNFxuNSBcbjYgXG43XG45NlxuOTdcbjk4XG45OSJd)
```
Œ†     # push the binary of the input
 ‚ÇÄ    # push 10
  √∏o  # remove ^ until no change
    ¬¨ # logical NOT
```
[Answer]
# D, ~~209~~ 170 bytes
```
import std.stdio;import std.format;import std.conv;void main(char[][]a){string b=format("%b",to!int(a[1]));int i;foreach(c;b){i+=c=='1'?1:-1;if(i<0)break;}writeln(i==0);}
```
This does exactly what it is supposed to do without any additions or benefits.
[Answer]
# C, 67 bytes
```
n;main(i){for(scanf("%d",&n);n*i;n/=2)i+=1-n%2*2;putchar(48+!~-i);}
```
Pretty much a port of my python submission.
[Answer]
# Prolog, 147 bytes
```
b(N,[X|L]):-N>1,X is N mod 2,Y is N//2,b(Y,L).
b(N,[N]).
q([H|T],N):-N>=0,(H=0->X is N+1;X is N-1),q(T,X).
q([],N):-N=0.
p(X):-b(X,L),!,q(L,0).
```
**How it works**  
```
b(N,[X|L]):-N>1,X is N mod 2,Y is N//2,b(Y,L).
b(N,[N]).
```
Converts decimal number N to it's binary representation as a list (reversed). Meaning:  
```
b(42,[0,1,0,1,0,1]) is true
```
Then:
```
q([H|T],N):-N>=0,(H=0->X is N+1;X is N-1),q(T,X).
q([],N):-N=0.
```
Recurses over list [H|T] increasing N if head element is 0 otherwise decreasing it.  
If N at any point becomes negative or if N in the end is not 0 return false, else true.  
  
The cut in
```
p(X):-b(X,L),!,q(L,0).
```
Is there to prevent backtracking and finding non-binary solutions to b(N,[N])
  
  
**Testing**  
Try it out online [here](http://swish.swi-prolog.org/)  
Run it with a query like:
```
p(42).
```
[Answer]
## PowerShell, 106 Bytes
```
param($a)$b=[convert]::ToString($a,2);1..$b.Length|%{if($b[$_-1]%2){$c++}else{$c--}if($c-lt0){0;exit}};!$c
```
Not going to win any shortest-length competitions, that's for sure. But hey, at least it's beating Java?
Uses the very long .NET call `[convert]::ToString($a,2)` to convert our input number to a string representing the binary digits. We then for-loop through that string with `1..$b.length|%{..}`. Each loop, if our digit is a `1` (evaluated with `%2` rather than `-eq1` to save a couple bytes), we increment our counter; else, we decrement it. If we ever reach negative, that means there were more `)` than `(` encountered so far, so we output `0` and `exit`. Once we're through the loop, `$c` is either `0` or some number `>0`, so we take the logical-not `!` of it, which gets output.
This has the quirk of outputting `0` if the parens are mismatched because we have more `)`, but outputting `False` if the parens are mismatched because we have more `(`. Essentially functionally equivalent falsy statements, just interesting. If the parens all match, outputs `True`.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 bytes
```
B-*√Ñ·πÄo·π™∆ä¬¨
```
[Try it online!](https://tio.run/##ASYA2f9qZWxsef//Qi0qw4ThuYBv4bmqxorCrP/ItzIsw4dLxorigqxZ/w "Jelly ‚Äì Try It Online")
```
B            Convert to binary.
 -*          Raise -1 to the power of each digit.
   √Ñ   ∆ä     For the cumulative sums of the resulting list:
     o  ¬¨    neither
    ·πÄ        is its maximum non-zero
      ·π™      nor is its last element.
```
Replacement came out a bit longer:
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
B¬¨≈ì·π£√ò.·∫é$√êL·πÜ
```
[Try it online!](https://tio.run/##ASsA1P9qZWxsef//QsKsxZPhuaPDmC7huo4kw5BM4bmG/8i3MizDh0vGiuKCrFn/ "Jelly ‚Äì Try It Online")
[Answer]
# [PowerShell Core](https://github.com/PowerShell/PowerShell), ~~74~~ 72 bytes
```
for($t=[convert]::ToString("$args",2);$r-ne($t=$t-replace10)){$r=$t}
!$t
```
[Try it online!](https://tio.run/##RY3dToNAEIWv2adYmtFAAg00xYs2JCZ9AI30rmkaXIe2BlmcHfwJ8uw4mKoXJ/NzznzT2nckd8K6jo0lHKHK@7GyFADnO2ObNyTer1ZbWzCdm2Mwg5KObhYtwjVQ3OCUA44J27o0mCZh2APJZlA@8DgoBUwdnz51rheRThOR1OWkZaQzmTPpsxul0vk8TZKvq155gB8tGsYnuYKDjs@NvmDEI3RdzeL4fnANlQRC5e3ui03n2L7cPT7L5V7fCsYrOmPQuYnyR4zxVV8Ya4ls0fGmdPjzaVo8/OL/Q4Maxm8 "PowerShell Core ‚Äì Try It Online")
## Explanations
```
for(
    $t=[convert]::ToString("$args",2); # converts the given argument to a binary string
    $r-ne($t=$t-replace10)){$r=$t}     # Until we can't find occurences of 10, remove them from the string
!$t                                    # Returns a truthy value if empty string
```
-2 bytes thanks to [mazzy](https://codegolf.stackexchange.com/users/80745/mazzy)!
[Answer]
# GNU Sed (with eval extension), 27
```
s/.*/dc -e2o&p/e
:
s/10//
t
```
Sed doesn't really have a defined idea of truthy and falsey, so here I am claiming that the empty string means truthy and all other strings mean falsey.
If this is not acceptable, then we can do the following:
# GNU Sed (with eval extension), 44
```
s/.*/dc -e2o&p/e
:
s/10//
t
s/.\+/0/
s/^$/1/
```
This outputs 1 for truthy and 0 otherwise.
[Answer]
# ùîºùïäùïÑùïöùïü (ESMin), 21 chars / 43 bytes
```
√¥‚ü¶√Ø√ü·∏Ç]ƒà‚áÄ+$?‚ß∫·∏Ä:·∏Ä‚Ä°)‚Öã!·∏Ä)
```
`[Try it here (Firefox only).](http://molarmanful.github.io/ESMin/interpreter.html?eval=true&input=10&code=%C3%B4%E2%9F%A6%C3%AF%C3%9F%E1%B8%82%5D%C4%88%E2%87%80%2B%24%3F%E2%A7%BA%E1%B8%80%3A%E1%B8%80%E2%80%A1%29%E2%85%8B!%E1%B8%80%29)`
Note that this uses variables predefined to numbers (specifically 2 and 0). There are predefined number variables from 0 to 256.
## 19 chars / 40 bytes, non-competitive
```
‚ü¶√Ø√ü·∏Ç]ƒà‚áÄ+$?‚ß∫·∏Ä:·∏Ä‚Ä°)‚Öã!·∏Ä
```
`[Try it here (Firefox only).](http://molarmanful.github.io/ESMin/interpreter.html?eval=true&input=10&code=%E2%9F%A6%C3%AF%C3%9F%E1%B8%82%5D%C4%88%E2%87%80%2B%24%3F%E2%A7%BA%E1%B8%80%3A%E1%B8%80%E2%80%A1%29%E2%85%8B!%E1%B8%80)`
Decided to implement implicit output... However, previous output forms are still supported, so you get several output options!
[Answer]
## Java, ~~129~~ 131 bytes
```
boolean T(int i){int j=0,k=0;for(char[]a=Integer.toString(i,2).toCharArray();j<a.length&&k>=0;j++){k+=a[j]=='1'?1:-1;}return k==0;}
```
Probably can be shortened. Explanation to come. Thanks to Geobits for 4 bytes off!
[Answer]
# ùîºùïäùïÑùïöùïü (very noncompetitve), 6 chars / 8 bytes
```
!√Ø‚ìëƒ¶‚Ö©
```
`[Try it here (Firefox only).](http://molarmanful.github.io/ESMin/interpreter3.html?eval=true&input=11&code=!%C3%AF%E2%93%91%C4%A6%E2%85%A9)`
I've decided to revisit this challenge after a very, very long time. ùîºùïäùïÑùïöùïü has gotten so much better.
The reason this is a separate answer is because the 2 versions are almost completely different.
# Explanation
Converts input to binary, recursively replaces instances of 10, then checks if result is an empty string.
[Answer]
# C++, 61 bytes
I think the current C++ answer is wrong: it returns a truthy value for all even numbers, e.g. 4. Disclaimer: I was not able to use the mentioned compiler, so I used g++ 4.8.4. The problem lies in the use of the binary AND operator instead of the logical AND which is used to break early when the number of closing parentheses exceed the number of opening parentheses. This approach could work if `true` is represented as a word with an all true bit pattern. On my system, and probably most other systems, `true` is equivalent to `1`; only one bit is true. Also, `n/=2` is shorter than `n>>=1`. Here is an improved version as a function:
```
int f(int n,int c=0){for(;c>=0&&n;n/=2)c+=n&1?-1:1;return c;}
```
]