Skip to main content
2 of 2
changed 2-9 to ^01 (length-neutral change, but more sensible)
andytech
  • 349
  • 1
  • 4

Perl 5, 21 +2 (-ap) = 23 bytes

$_+=$F[0]while/[^01]/ 

Run with -a and -p, input to stdin. Just keeps repeatedly adding the input for as long as the result contains anything other than digits 0 and 1.

Try it online!

andytech
  • 349
  • 1
  • 4