perl -e '@a=qw(g a t c g a t c g a t c); for(1..1000000){$x=int(1000*rand());$s.=$a[$x]} while($s=~/(?\w{3,})\w*\g{repeat}/g){ $+{repeat};$c=()=$s=~/$+{repeat}/;print "$+{repeat} : $c\n"}' : 1 : 1 : 1 : 1