Skip to main content
Commonmark migration
Source Link

#PHP, 93 bytes

PHP, 93 bytes

<?=$n=$argn;for($i=2;$n>1;$k&&$p=print($p?"*":"=")."$i^$k",$i++)for($k=0;$n%$i<1;$n/=$i)$k++;

I could do 89 bytes with PHP 5.5 (or later), but that postdates the challenge by more than 2 years:

<?=$n=$argn;for($i=2;$n>1;$k&&$p=print"=*"[$p]."$i^$k",$i++)for($k=0;$n%$i<1;$n/=$i)$k++;

Run as pipe with -nF or try them online.

#PHP, 93 bytes

<?=$n=$argn;for($i=2;$n>1;$k&&$p=print($p?"*":"=")."$i^$k",$i++)for($k=0;$n%$i<1;$n/=$i)$k++;

I could do 89 bytes with PHP 5.5 (or later), but that postdates the challenge by more than 2 years:

<?=$n=$argn;for($i=2;$n>1;$k&&$p=print"=*"[$p]."$i^$k",$i++)for($k=0;$n%$i<1;$n/=$i)$k++;

Run as pipe with -nF or try them online.

PHP, 93 bytes

<?=$n=$argn;for($i=2;$n>1;$k&&$p=print($p?"*":"=")."$i^$k",$i++)for($k=0;$n%$i<1;$n/=$i)$k++;

I could do 89 bytes with PHP 5.5 (or later), but that postdates the challenge by more than 2 years:

<?=$n=$argn;for($i=2;$n>1;$k&&$p=print"=*"[$p]."$i^$k",$i++)for($k=0;$n%$i<1;$n/=$i)$k++;

Run as pipe with -nF or try them online.

Source Link
Titus
  • 14.8k
  • 1
  • 24
  • 41

#PHP, 93 bytes

<?=$n=$argn;for($i=2;$n>1;$k&&$p=print($p?"*":"=")."$i^$k",$i++)for($k=0;$n%$i<1;$n/=$i)$k++;

I could do 89 bytes with PHP 5.5 (or later), but that postdates the challenge by more than 2 years:

<?=$n=$argn;for($i=2;$n>1;$k&&$p=print"=*"[$p]."$i^$k",$i++)for($k=0;$n%$i<1;$n/=$i)$k++;

Run as pipe with -nF or try them online.