A while back I realised that I could find all anagrams in a language by assigning each letter to a prime number (I call this prime coding, though it probably has a proper name) then multiply the letters in a word to create some value. Then words that are anagrams will have the same value.
When I thought about this practically, the numbers started getting pretty big. A 10 letter word is likely to be over 1 trillion. In an attempt to reduce these values I turned to Gaussian Integers. So that I could use smaller numbers as my primes.
- Are there any more types of prime numbers I could use to further reduce values?
I suspect Quarternions and Octonians(?) and further powers of 2 down that route could potentially reduce the value at a cost of the number of numbers needed. So presumably there would be an optimal pay off here. But I'm more interested in a different approach.
Thank you in advance