in reply to FASTA riddle.

What you're doing is "motif finding," a well-studied and difficult problem. I suggest finding a software package or published algorithm to do it for you.