[Question]
  [
Yesterday while playing with my kid I noticed the number in his toy train:
[![4281](https://i.stack.imgur.com/iBozFm.jpg)](https://i.stack.imgur.com/iBozFm.jpg)
So we have $$4281$$ that can be split into $$4-2-8-1$$ or $$2^2-2^1-2^3-2^0$$
So simple challenge: given a non-negative number as input, return consistent truthy and falsey values that represent whether or not the string representation of the number (in base 10 and without leading zeroes) can be somehow split into numbers that are powers of 2.
Examples:
```
4281      truthy (4-2-8-1)
164       truthy (16-4 or 1-64)
8192      truthy (the number itself is a power of 2)
81024     truthy (8-1024 or 8-1-02-4)
101       truthy (1-01)
0         falsey (0 cannot be represented as 2^x for any x)
1         truthy
3         falsey
234789    falsey
256323    falsey (we have 256 and 32 but then 3)
8132      truthy (8-1-32)
Tests for very large numbers (not really necessary to be handled by your code):
81024256641116  truthy (8-1024-256-64-1-1-16)
64512819237913  falsey
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so may the shortest code for each language win!
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~9~~ 8 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
Ýos.œåPZ
```
-1 byte thanks to *@Emigna* by using `Z` (max) for the list of 0s and 1s to mimic an `any` command for `1` (truthy).
[Try it online](https://tio.run/##yy9OTMpM/X@x6f/hufnFekcnH14aEPX/v4WhgZEJAA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9TVmmvpPCobZKCkn3lxab/h@fmF@sdnXx4aUDUf53/JkYWhlyGZiZcFoaWRkDCwMiEy4DLkMuYy8jYxNzCksvI1MzYyBgoY2wEAA). (NOTE: The `т` in the header is `100` to only get the first 100 power of 2 numbers, instead of the first input amount of power of 2 numbers. It works with the input amount of power of 2 as well, but is pretty inefficient and might timeout on TIO if the input is large enough.)
**Explanation:**
```
Ý            # Create a list in the range [0,n], where n is the (implicit) input
             # (or 100 in the TIO)
             #  i.e. 81024 → [0,1,2,3,...,81024]
 o           # Raise 2 to the `i`'th power for each `i` in the list
             #  → [1,2,4,8,...,451..216 (nr with 24391 digits)]
  s          # Swap to take the input
   .œ        # Create each possible partition of this input
             #  i.e. 81024 → [["8","1","0","2","4"],["8","1","0","24"],...,["8102","4"],["81024"]]
     å       # Check for each if it's in the list of powers of 2
             #  → [[1,1,0,1,1],[1,1,0,0],...,[0,1],[0]]
      P      # Check for each inner list whether all are truthy
             #  → [0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0]
       Z     # Take the maximum (and output implicitly)
             #  → 1 (truthy)
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 54 bytes
```
f=(v,o=10)=>v&v-1|!v?v>o?f(v%o)&f(v/o|0)|f(v,o*10):0:1
```
[Try it online!](https://tio.run/##FYpBDoIwFESvUheS1hTsbysCSeEgxgVBajTIJ2J@WPTutWzmZWbeu6d@Hb6v5ZfP@Bhj9I6TRAdKuJYyyiEcqKMWO8/piCJLOGNQIvjdOyWvUQ3EAecVp7GY8MlvVlcgGZRWsgpqvafSqag0SmYk08ZeqzrxUhpt9t8kCxTci0@/8I25lnm@CSHiHw "JavaScript (Node.js) – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~69~~ ~~64~~ 58 bytes
```
f=(x,m=10,q=!(x%m&x%m-1|!x))=>x<m?q:q&&f(x/m|0)||f(x,10*m)
```
[Try it online!](https://tio.run/##XVBbbsIwEPz3KZaPojiKwY80DVVDD1K1kgGnUCV2SAwYKXdPN6BWwEp@zXhnZ/dHH3W3bneNZ9ZtzDCURRSSuhA82ReTKDzVU1xM9JNAabEMb/X7/nU/nZZRmNc9p32Pt0TwuKbD2tnOVWZWue/oI5W5SEBkaQK5WMhx5xIfHMEEVAJSpS/5As/nTEk18gp/CS4@Z7VuogDFElCbUkrmMRnl4BK@PfjtGaKUSZYzQQnWgHtKZCwF14JgWUrJWP6e91sD9lCvTAs735mqhF0HGhp3QsSVIMckdHuXhLUQooTDX5S66gwyHNbaWudhZaA1TWs6Y73ZgO5AfgUo0Ym2Zwho9T/3qkrUgxi5TuUWuIznttzJwFYfzTg41N2AkrA6eMCmLKjRuXpoF50zhT3F8@EX "JavaScript (Node.js) – Try It Online")
Input as number. The logic part is quite convoluted, so no idea how to untangle it and get rid of `q`.
-11 bytes by golfing the power-of-2 check.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 [bytes](https://github.com/DennisMitchell/jellylanguage/wiki/Code-page)
```
ŒṖḌl2ĊƑ€Ẹ
```
[Check out the test suite!](https://tio.run/##y0rNyan8///opIc7pz3c0ZNjdKTr2MRHTWse7trx/@GOTWFAps7hdhUg5f7/v4mRhaGCoZmJgoWhpRGQMDAyUTBQMFQwVjAyNjG3sFQwMjUzNjIGyhhDpYECZiaGhoZmCmYmpoZGIH3G5paGxgA "Jelly – Try It Online")
---
### Alternative
Doesn't work for the large test cases due to precision issues.
```
ŒṖḌæḟƑ€2Ẹ
```
[Check out the test suite!](https://tio.run/##y0rNyan8///opIc7pz3c0XN42cMd849NfNS0xujhrh3/H@7YFAZk6xxuVwFS7v//mxhZGCoYmpkoWBhaGgEJAyMTBUMDQwUDBUMFYwUjYxNzC0sFI1MzYyNjoKyxEQA "Jelly – Try It Online")
### How?
**Program I**
```
ŒṖḌl2ĊƑ€Ẹ     Full program. N = integer input.
ŒṖ            All possible partitions of the digits of N.
  Ḍ           Undecimal (i.e. join to numbers).
   l2         Log2. Note: returns (-inf+nanj) for 0, so it doesn't fail.
     ĊƑ€      For each, check if the logarithm equals its ceil.
        Ẹ     Any. Return 0 if there are no truthy elements, 1 otherwise.
```
**Program II**
```
ŒṖḌæḟƑ€2Ẹ     Full program. N = integer input.
ŒṖ            All possible partitions of the digits of N.
  Ḍ           Undecimal (i.e. join to numbers).
     Ƒ€       For each partition, check whether its elements are invariant under...
   æḟ  2      Flooring to the nearest power of 2.
        Ẹ     Any. Return 0 if there are no truthy elements, 1 otherwise.
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~75~~ 69 bytes
-6 bytes thanks @Arnauld. At most 32-bit support
```
f=x=>+x?[...x].some((_,i)=>(y=x.slice(0,++i))&~-y?0:f(x.slice(i))):!x
```
[Try it online!](https://tio.run/##bc5NDoIwEAXgvbeQhZkGaPoDCJjCQYwxBFtTg9RYY8rGq1dduDGz/V7ezLsMz8GPd3t75LM76RiNCqpLQ7@nlIYD9e6qAY6ZJaqDRQXqJztqYFmaWkI2r3zpWWvg5x8j7TrE3ehm7yZNJ3cGA0khap4Qsvp3XhUY17wRuDOBFhh6HEOJoZDFtm7QpKykkPgWiW7k7Ps3vgE "JavaScript (Node.js) – Try It Online")
Input as a string. 
[Answer]
# [Python 2](https://docs.python.org/2/), ~~72~~ 70 bytes
```
f=lambda n,m=10:n>=m/10and(n%m&n%m-1<1and(n/m<1or f(n/m))or f(n,m*10))
```
[Try it online!](https://tio.run/##JU1LDoIwEN1zitlorKmhM61YCPUuGGwkoQOBbjx9bXHx5v2SN@s3fhamlLybh/AaB2AZHKqOny7UqAYeL3wK54wb9njYOvS4bOCLEuKvZLiiEiLF9x53cGDIogRsjASLLZWrKBuVQwlaAmnzsG3me6NJl15TVfm8ViZg4oP3rgJYt4ljflICkX4 "Python 2 – Try It Online")
[Answer]
# JavaScript, 59 bytes
```
s=>eval(`/^(${(g=x=>x>s?1:x+'|0*'+g(x+x))(1)})+$/`).test(s)
```
[Try it online!](https://tio.run/##XVBBbsIwELz7FXtAwoaYxHaahkpJH1IVYcABquBEsQGjtm9PN1StgD3Y8o53ZnY@9Em7dbdvPbfNxvRV0buiNCdd02W8oKNPui1CUYbSvYqXMB1/JZPxdEvDNDBGBftm01G8ZDNvnKeO9evGuqY2s7rZ0rdU5iICkaUR5GIuhzOR@EiwGYGKQKr0OZ/j/ZQpqQZc4S@RiPfZQbc0QFFCRVGJERJPyMAH1/Ld0e8uQFMuec4FIygC95DIeApNB4JnKSOD/j3udwbs8bAyHey9M3UFewca2uaMnaYCOQyh3bsh1MIWIwn8VaVrZxBJYK2tbTysDHSm7Ywz1psNaAdyEaBCJ9peIKDV/9lfVqIeyMhvLLeNaz63cmcDO30yQ3LIuwElYXX0gEtZUINz9bAuOucKd8JwH4PiCQY4ifsf "JavaScript (Node.js) – Try It Online")
Builds a regex like `/^(1|0*2|0*4|0*8|0*16|0*32|…|0*1)+$/` of powers of 2, and tests it on `s`.
Only works up to the precision of JavaScript numbers, of course: eventually the terms in the regex will look like `1.2345678e30` (or `Inf`). But since powers of 2 are easy to represent accurately in floating-point, they'll never be *wrong* integers, which would be more disqualifying, I think.
@tsh saved 14 bytes. Neato!
[Answer]
# [Python 2](https://docs.python.org/2/), 85 bytes
```
f=lambda n:bin(int(n)).count('1')==1or any(f(n[:i])*f(n[i:])for i in range(1,len(n)))
```
[Try it online!](https://tio.run/##dVDRboMwEHvfV1jaA8k0piZhjCL1S6ZOCm0yItEDQVjbr2dXVVth1fJ0Oju2z9051i3pafKbxh6qvQWVVSARKAqS8mXXjjwlKpGbjWp7WDoLL@i9DFv5dBlCuZWegYBA6C19OqGeG0eX33LqehaCF0mmC5UA8hH8Yj/G@gyRpTotUiUffmkqz5j1h6byNANbqDTPZtxCrfWdZKwdaDxUjhPFwTUeYYBF1x5503rohcBKs91SgPPwdsZaXQL92HjbDI5ZK@wsURtROfSu693gKLo97AD9cYK/NoXT/LS5ztXtBpp7kxuoTfZWrJN/wNfcaJMs4x0davvlwCDn2MNoVGMEl0MwiwbMfYXcQGq0nL4B "Python 2 – Try It Online")
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), ~~28~~ ~~24~~ 23 bytes
*-4 bytes thanks to Jo King*
```
{?/^[0*@(2 X**^32)]+$/}
```
[Try it online!](https://tio.run/##NYzBCsIwEETv@xU5FGnjQrO76TZBRD9DECsezKmi1FMRvz0mBy/zmMcwr/sya36sZpPMPn8O/XR29tiyOVk7CXeXbdN/8/u2mtQ2186k5wKeAyGQeoRAkWs6LoVc0a4QQRBY/Bhi4aDCUkfynxalnogUQf1AXF9kjCS7/AM "Perl 6 – Try It Online")
Handles powers up to 231.
[Answer]
# APL(NARS), 154 chars, 308 bytes
```
∇r←f w;g;b;z;k
   g←{⍵≤0:1⋄t=⌊t←2⍟⍵}⋄→A×⍳∼w≤9⋄r←g w⋄→0
A: z←w⋄b←0⋄k←1
B: b+←k×10∣z⋄z←⌊z÷10
   →C×⍳∼g b⋄r←∇z⋄→0×⍳r
C: k×←10⋄→B×⍳z≠0
   r←0
∇
h←{⍵=0:0⋄f ⍵}
```
The function for the exercise it is h. The algorithm not seems exponential or factorial... test:
```
  h¨ 4281 164 8192 81024 101 
1 1 1 1 1 
  h¨ 0 1 3 234789 256323 8132
0 1 0 0 0 1 
  h 81024256641116
1
  h 64512819237913
0
```
[Answer]
# [Python 2](https://docs.python.org/2/), 57 bytes
```
f=lambda n,k=10:k<11*n>n%k&n%k-1<(n<k)|f(n/k)|f(n,10*k)*n
```
[Try it online!](https://tio.run/##NY7dCoMwDIWv9Sly02mlsqat9QfnuziGTLpFcQ4c7N1di@wiCd8JyTnzZ71PpPZ9uDz65/XWAwl3Qdm4FjGjjpg7@cqxTal1/DukdD6GQJk5ntE@TAtsMBKkcZQaVaEAtEZAhbUKXSoPKIMcUP9FVVhrENFy4Q@lAC1AaVNWtZ@F1cqzNQWq8EiXNWoe8yaOgh8Fv81DNC8jrZAwNG/IO2CvBBj4dOAjch4f@/0H "Python 2 – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 86 bytes
```
lambda n:re.match('^(%s)*$'%'|'.join('0*'+`1<<k`for k in range(n)),`n`)and 0;import re
```
[Try it online!](https://tio.run/##bc5NDoIwEIbhvaeYhaQtElJQ8Q@u4AmMoUorCExJqQsS745GTWTR7Zsn30w32FJjPKrsNDaivRQCcG9k2Ap7LSk5U69n/px45EnCu66QEu6TRR6laZ0rbaCGCsEIvEmKjAU55kxgAfxQtZ02FowclWh6OQRgzcOWA2Rw1CgD4LOZ6Hv5NopGyYpBlv3IpPPI2fmnfocn2mmXU/vPsRO731g7zyXOunHWrXN3N7HjCw "Python 2 – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), 55 bytes
```
->n{a=*b=1;a<<b*=2until b>n;n.to_s=~/^(0*(#{a*?|}))*$/}
```
[Try it online!](https://tio.run/##FYrdDoIgAIVfha0ulJHyY4ZT7EEYNbhwcytypRsN6NUJb87Zd77z3sw3TSKdRuu1gEaQXg@DgYJudp0fwIy2t9X6un/Er74VGBYHr@E1xLKExzom2VBOECBtgwAnHd0T0ww4jwgwBChrLrzLfW4ZZbtn@UUwUdVTLz64sADp0CSdUjH9AQ "Ruby – Try It Online")
Output is `0` if true and `nil` if false.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 49 bytes
```
->n{n.to_s=~/^(0*(#{(0..n).map{|x|2**x}*?|}))*$/}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6vOk@vJD@@2LZOP07DQEtDuVrDQE8vT1MvN7GguqaixkhLq6JWy76mVlNTS0W/9r@GoZ6esRFcukAhukInLboiNraWq0AhLdrQwDD2PwA "Ruby – Try It Online")
Only works in theory. Takes forever for large values of `n`
[Answer]
# PHP, 101 bytes
Can´t seem to get this below 100; but I could get it *to* 100 if `101` was a falsy case.
```
function f($s){for($x=.5;$s>=$x*=2;)if(preg_match("/^$x(.*)$/",$s,$m)?!~$m[1]||f(+$m[1]):0)return 1;}
```
returns \$NULL\$ for falsy and \$1\$ for truthy.
[Try it online](http://sandbox.onlinephpfunctions.com/code/06b5edb87454764e8febe11775118f81a28a211b).
**variations:**
```
for($x=.5;$s>=$x*=2;)
while($s>=$x=1<<$i++)   # yields notices "undefined variable $i"
?!~$m[1]||f(+$m[1]):0
?~$m[1]?f(+$m[1]):1:0
```
# PHP 5 or older, 95 bytes
```
function f($s){while($s>=$x=1<<$i++)if(ereg("^$x(.*)$",$s,$m)?$m[1]>""?f(+$m[1]):1:0)return 1;}
```
[Answer]
# [Red](http://www.red-lang.org), 212 211 bytes
```
func[n][g: func[x][(log-2 do x)% 1 = 0]repeat i 2 **((length? s: form n)- 1)[b: a:
copy[] k: i foreach c s[append b c if k % 2 = 0[alter a g rejoin b
b: copy[]]k: k / 2]append a g form c if all a[return on]]off]
```
[Try it online!](https://tio.run/##TY3BboMwEETv/oq5RIJIUbGhKUGK8g@9Wj4YWBOKayOHSOnXU5e2kNvMzszbQO38Tq1UzFSzubtGOiW7Cot8KJlY3x0EWo9HugPHGZkKNJKe0ENgv08SS66brhfc4sqHT7j0AJ7KuoKuWOPHL6kwVLEeU9LNFQ1uUo8juRZ1NL3BgF2ERbbUdqIAjQ6BPnzvULMI@qWoSBnwAqH@1j@15eUC0dZCy0DTPTh4p5Q3Rs1j6N0Eg0KUnP0bfixWXfKTeDKZ2CKebZNsu64qX5XIi7fytNnXYy7yJ2ou2PwN "Red – Try It Online")
Another long submission, but I'm not comletely dissatisfied, because there is no built-in for finding all substrings in Red.
## More readable:
```
f: func [ n ] [
    g: func [ x ] [ (log-2 do x) % 1 = 0 ]
    repeat i 2 ** ((length? s: form n) - 1) [
        b: a: copy []
        k: i
        foreach c s [
            append b c
            if k % 2 = 0 [ 
                append a g rejoin b
                b: copy []
            ]
            k: k / 2 
        ]
        append a g form c
        if all a[ return on ]
    ]
    off
]
```
[Answer]
# Axiom, 198 bytes
```
G(a)==(a<=1=>2>1;x:=log_2 a;x=floor x)
F(n)==(n<=9=>G n;z:=n;b:=0;k:=1;repeat(b:=b+k*(z rem 10);z:=z quo 10;if G b and F z then return 2>1;k:=k*10;z<=0=>break);1>1)
H(n:NNI):Boolean==(n=0=>1>1;F n)
```
ungolf and test
```
g(a)==(a<=1=>2>1;x:=log_2 a;x=floor x)
f(n)==
   n<=9=>g n
   z:=n;b:=0;k:=1
   repeat
      b:=b+k*(z rem 10);z:=z quo 10;
      if g b and f z then return 2>1
      k:=k*10
      z<=0=>break
   1>1
h(n:NNI):Boolean==(n=0=>1>1;f n)
(15) -> [[i,h i] for i in [4281,164,8192,81024,101]]
   (15)  [[4281,true],[164,true],[8192,true],[81024,true],[101,true]]
                                                      Type: List List Any
(16) -> [[i,h i] for i in [0,1,3,234789,256323,8132]]
   (16)  [[0,false],[1,true],[3,false],[234789,false],[256323,false],[8132,true]]
                                                      Type: List List Any
(17) -> [[i,h i] for i in [81024256641116, 64512819237913]]
   (17)  [[81024256641116,true],[64512819237913,false]]
                                                      Type: List List Any
(18) -> h 44444444444444444444444444
   (18)  true
                                                            Type: Boolean
(19) -> h 44444444444444444128444444444
   (19)  true
                                                            Type: Boolean
(20) -> h 4444444444444444412825444444444
   (20)  false
                                                            Type: Boolean
(21) -> h 2222222222222244444444444444444412822222222222210248888888888882048888888888888888
   (21)  true
                                                            Type: Boolean
(22) -> h 222222222222224444444444444444441282222222222225128888888888882048888888888888888
   (22)  true
                                                            Type: Boolean
```
[Answer]
# Powershell, 56 bytes
```
$x=(0..63|%{1-shl$_})-join'|0*'
"$args"-match"^(0*$x)+$"
```
Test script:
```
$f = {
    $x=(0..63|%{1-shl$_})-join'|0*'
    "$args"-match"^(0*$x)+$"
}
@(
    ,(4281            ,$true)
    ,(164             ,$true)
    ,(8192            ,$true)
    ,(81024           ,$true)
    ,(101             ,$true)
    ,(0               ,$false)
    ,(1               ,$true)
    ,(3               ,$false)
    ,(234789          ,$false)
    ,(256323          ,$false)
    ,(8132            ,$true)
    ,("81024256641116"  ,$true)
    ,("64512819237913"  ,$false)
) | % {
    $n, $expected = $_
    $result = &$f $n
    "$($result-eq$expected): $result <- $n"
}
```
Output:
```
True: True <- 4281
True: True <- 164
True: True <- 8192
True: True <- 81024
True: True <- 101
True: False <- 0
True: True <- 1
True: False <- 3
True: False <- 234789
True: False <- 256323
True: True <- 8132
True: True <- 81024256641116
True: False <- 64512819237913
```
Explanation:
Builds a regex like `^(0*1|0*2|0*4|0*8|0*16|0*32|…)+$` of powers of 2, and tests it on arguments.
[Answer]
# Japt `-!`, 12 bytes
Takes input as a string.
```
ÊÆòXÄÃex_&ZÉ
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.6&code=ysbyWMTDZXhfJlrJ&input=IjQyODEiCi0h)
[Answer]
## C# 157 bytes
```
bool P(string s,int i=1)=>i>=s.Length?((Func<ulong,bool>)((x)=>(x!=0)&&((x&(x-1))==0)))(ulong.Parse(s)):(P(s,i+1)||(P(s.Substring(0,i))&&P(s.Substring(i))));
```
You can [Try it online](https://tio.run/##XZHfT8IwEMef2V9xLob04iDrNgaIwwcTnzBZwoMPxocyKjQZrWk3xIz97dgOjMGm6V0/d/e9/ijMoFCan2oj5AaW36biu5nXc8P7rFelKKAomTGQa7XRbOc1Xu/CTcUqa/ZKrOGFCUkQmtNKqRJyYirt9EwgZAUio5jNxTwzwwWXm2r7SMhzLYuHulRyE7iSORJysEnkcJOF2O/bXZ8cBhQxs3tE0qUOc6YNJwbxntgegbijeDw6d7isV@eeJAwEWoVraBHi7GQvdgZv77BmFYMMJP@CX9aAn0QT6gfg0zRxZkKn0dmGUQdo2IXDzndL7JYoTsaTaeeN0jiKzyXxX6nFaUIpTR1JkxGNnHI8ntLYh9Y9@If9BVZsgeyZhqLWmruXk90x0cYbD/6N3pOSRpV8@KpFxRdCcnLrPysNst6tuIbmotKC5qYurZqBJicXiq2PsyvNXuvZ2Z5@AA)
[Answer]
# APL(NARS), 70 chars, 140 bytes
```
P←{k←↑⍴⍵⋄x←11 1‼k k⋄y←⍵⋄∪{x[⍵;]⊂y}¨⍳↑⍴x}
f←{⍵=0:0⋄∨/∧/¨y=⌊y←2⍟⍎¨¨P⍕⍵}
```
test:
```
  f¨ 4281 164 8192 81024 101
1 1 1 1 1 
  f¨ 0 1 3 234789 256323 8132
0 1 0 0 0 1 
  f 126
0
```
i not try to do other more big numbers...
i have to note that P is not normal partition, but it is one partition
where all element are subset that have member all consecutive, for example
```
  ⎕fmt P 'abc'
┌4──────────────────────────────────────────────────┐
│┌1─────┐ ┌2─────────┐ ┌2─────────┐ ┌3─────────────┐│
││┌3───┐│ │┌2──┐ ┌1─┐│ │┌1─┐ ┌2──┐│ │┌1─┐ ┌1─┐ ┌1─┐││
│││ abc││ ││ ab│ │ c││ ││ a│ │ bc││ ││ a│ │ b│ │ c│││
││└────┘2 │└───┘ └──┘2 │└──┘ └───┘2 │└──┘ └──┘ └──┘2│
│└∊─────┘ └∊─────────┘ └∊─────────┘ └∊─────────────┘3
└∊──────────────────────────────────────────────────┘
```
note that is absent the element ((ac) (b)) or better ,,¨('ac')'b'
```
  ⎕fmt ,,¨('ac')'b'
┌2─────────┐
│┌2──┐ ┌1─┐│
││ ac│ │ b││
│└───┘ └──┘2
└∊─────────┘
```
[Answer]
# POSIX ERE, 91 bytes
```
(0*([1248]|16|32|64|128|256|512|1024|2048|4096|8192|16384|32768|65536|131072|262144|524288))+
```
This is totally cheating, based on the text *large numbers (not really necessary to be handled by your code)* in the question; it handles all values in the size range of the examples. Obviously can be extended up to full range of 32- or 64-bit integer types at the expense of size. I mainly wrote it as a demonstration of how the problem naturally fits the tool. A fun exercise would be rewriting it as a program that generates the ERE for arbitrary range then matches against it.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), `-DA=asprintf(&c,` + 108 = 124 bytes
```
p,c;f(a,i){c="^(0*(1";for(i=0;i<31;)A"%s|%d",c,1<<++i);A"%s))+$",c);regcomp(&p,c,1);a=!regexec(&p,a,0,0,0);}
```
[Try it online!](https://tio.run/##XYrBCoJAFEXX9RU2ZMzLCZyZIOPpIugzIhheKgNloi0C89ebtAIt7urcc2iVEzlXCsKMG2GhoYQdebjkkmF2rbhNQrSxlgg75tcP/8QECRnHQWAB@wsgmHcfYJXmdL2UfFH2BaBJZt2V3lPqLyPCfoCts8XNuxhbcGimk7LqMONMqmjt@adDwcSXGAAOPpKhGgVv/C@0Ggda/Xql15toOxQf/m30oPXbtO5J2dnktVvtd4mpv@GCxAs "C (gcc) – Try It Online")
This builds a regex of the powers of 2 up to 2\*\*32, and then matches the input string against it.
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 56 bytes
```
f=(x,c=v=1)=>x<v?x.match('^('+c+')+$'):f(x,c+'|'+(v*=2))
```
[Try it online!](https://tio.run/##XVBBboMwELzzij1UMg6QYJtSUpX0IVUjOcSUVMRG2CFE6t/pOlGrEB9seWZ3Zna/5SBt1R86l2izV9NUl@EYV@VQMlpuxrfhfVwepauakGxDElURodEToa@1r4rID4nCYVFySqfKaGtatWzNV/iR8YLFwPIshoKtub9Tjp8UwRhEDFxkL8Ua3@dccOF5gVUsZZ9o14UjlBtAj4gQSmmwWgReEa7H9SfXXCDMEp4UCaMB2sCcYnmSgemBJXlGA59gzrtGgT4dd6qHg7OqreFgQUJnzoiYGrhvwsCzJvRCiAYp/J1atlYhk0IltTYOdgp61fXKKu3UHqQFvh2hxiRSX2DEqP@9N9VAPIgFt8XcA9cN3dudFTRyUH53qLsHwWF3coBDaRA@uXgYF5MnAmdarKZf "JavaScript (Node.js) – Try It Online")
]