$ perl -E '$_=1x shift;while(/^(11+?)\1+$/){say length$1;$_=1x(length( +)/length$1)}say length' 45 3 3 5
There you go, prime factors in increasing size. I'm sure it can be golfed down even further.
In reply to Re: Calculate prime factors for a given number in a perl one-liner
by moritz
in thread Calculate prime factors for a given numer in a perl one-liner
by andmott
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |