$ perl -E '$_=1x shift;while(/^(11+?)\1+$/){say length$1;$_=1x(length()/length$1)}say length' 45 3 3 5