Anagram formula