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

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

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

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

Try it online!Try it online!

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

$_+=$F[0]while/[2-9]/ 

Run with -a and -p, input to stdin. Just keeps repeatedly adding the input for as long as the result contains any digits from 2 to 9.

Try it online!

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!

Source Link
andytech
  • 349
  • 1
  • 4

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

$_+=$F[0]while/[2-9]/ 

Run with -a and -p, input to stdin. Just keeps repeatedly adding the input for as long as the result contains any digits from 2 to 9.

Try it online!