Skip to main content
added 46 characters in body
Source Link

PHP, 80 7474 66 chars

Very straightforward PHP solution:

<?for($i=0;$i<$l=strlen;$i<$l=strlen($a=$argv[1]);$i++;){$s+=pow($a[$i]$a[$i++],$l);}echo$s==$a;;echo$s==$a;

It assumes error_reporting doesn't include notices, otherwise 5 more charsquite a few extra characters will be needed to initialize $s=0; and $i=0.

Thx @manatwork for shortening 6many chars.

PHP, 80 74 chars

Very straightforward PHP solution:

<?for($i=0;$i<$l=strlen($a=$argv[1]);$i++){$s+=pow($a[$i],$l);}echo$s==$a;

It assumes error_reporting doesn't include notices, otherwise 5 more chars will be needed to initialize $s=0;

Thx @manatwork for shortening 6 chars.

PHP, 80 74 66 chars

Very straightforward PHP solution:

<?for(;$i<$l=strlen($a=$argv[1]);)$s+=pow($a[$i++],$l);echo$s==$a;

It assumes error_reporting doesn't include notices, otherwise quite a few extra characters will be needed to initialize $s=0; and $i=0.

Thx @manatwork for shortening many chars.

added 46 characters in body
Source Link

PHP, 8080 74 chars

Very straightforward PHP solution:

<?$a=$argv[1];$l=strlenfor($a);for$i=0;$i<$l=strlen($i=0;$i<$l;$i++$a=$argv[1]);$i++){$s+=pow($a[$i],$l);}echo$s==$a;

It assumes error_reporting doesn't include notices, otherwise 5 more chars will be needed to initialize $s=0;

Thx @manatwork for shortening 6 chars.

PHP, 80 chars

Very straightforward PHP solution:

<?$a=$argv[1];$l=strlen($a);for($i=0;$i<$l;$i++){$s+=pow($a[$i],$l);}echo$s==$a;

It assumes error_reporting doesn't include notices, otherwise 5 more chars will be needed to initialize $s=0;

PHP, 80 74 chars

Very straightforward PHP solution:

<?for($i=0;$i<$l=strlen($a=$argv[1]);$i++){$s+=pow($a[$i],$l);}echo$s==$a;

It assumes error_reporting doesn't include notices, otherwise 5 more chars will be needed to initialize $s=0;

Thx @manatwork for shortening 6 chars.

Source Link

PHP, 80 chars

Very straightforward PHP solution:

<?$a=$argv[1];$l=strlen($a);for($i=0;$i<$l;$i++){$s+=pow($a[$i],$l);}echo$s==$a;

It assumes error_reporting doesn't include notices, otherwise 5 more chars will be needed to initialize $s=0;