Skip to main content
1 of 2
Andrew
  • 139
  • 3

PHP 119 bytes

<?php function f($n){$n1=strrev((string)$n);$r=$n+(int)$n1;for($i=2;$i<$r;$i++){if($r%$i==0){echo 0;f($r);}}die('1');}

More readable version:

<?php
function f($n){
    $n1 = strrev((string)$n);
    $r = $n + (int)$n1;
    for($i=2;$i<$r;$i++){
        if($r%$i == 0) {
            echo 0;
            f($r);
        }
    }
    die('1');
}

f(11431 );

Try it online!

Andrew
  • 139
  • 3