Skip to main content
1 of 2
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!

andytech
  • 349
  • 1
  • 4