Skip to main content
added 88 characters in body
Source Link
breadbox
  • 7.3k
  • 33
  • 45

Perl, 99 chars

Does not screw up on 139, 151, etc. Tested with number ranging from 1 to 9 digits.

$"=",";$%=1;$==$-=($n=<>)**.5; push@f,$==(($s=$=*$%-$s)+$-)/($%=($n-$s*$s)/$%)until$=>$-; say"$-;@f;" 

Note: $%, $=, and $- are all integer-forcing variables.

Perl, 99 chars

$"=",";$%=1;$==$-=($n=<>)**.5; push@f,$==(($s=$=*$%-$s)+$-)/($%=($n-$s*$s)/$%)until$=>$-; say"$-;@f;" 

Note: $%, $=, and $- are all integer-forcing variables.

Perl, 99 chars

Does not screw up on 139, 151, etc. Tested with number ranging from 1 to 9 digits.

$"=",";$%=1;$==$-=($n=<>)**.5; push@f,$==(($s=$=*$%-$s)+$-)/($%=($n-$s*$s)/$%)until$=>$-; say"$-;@f;" 

Note: $%, $=, and $- are all integer-forcing variables.

Source Link
breadbox
  • 7.3k
  • 33
  • 45

Perl, 99 chars

$"=",";$%=1;$==$-=($n=<>)**.5; push@f,$==(($s=$=*$%-$s)+$-)/($%=($n-$s*$s)/$%)until$=>$-; say"$-;@f;" 

Note: $%, $=, and $- are all integer-forcing variables.