Skip to main content
added 74 characters in body
Source Link
Andrew
  • 139
  • 3

PHP 119114 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;fdie($r'0');}}die('1');}

More readable version:

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

f(11431 );

Try it online!

I used this thing for counting bytes.

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!

PHP 114 bytes

<?php function f($n){$n1=strrev((string)$n);$r=$n+(int)$n1;for($i=2;$i<$r;$i++){if($r%$i==0){die('0');}}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) {
            die('0');
        }
    }
    die('1');
}

f(11431 );

Try it online!

I used this thing for counting bytes.

Source Link
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!