### Calculate a Two-Dimensional Primitive Root Diffuser

This script is an example implementation of the method suggested in US patent #5401921 (March 28, 1995) to calculate a two-dimensional primitive root diffuser. Enter your design frequencies at which the diffuser shall operate, and a desired size of the diffuser, based on a prime number P and a primitive root number of P. Note, that P-1 must have two coprime factors
which are non-devisible into each other. For example, for P = 157, P-1 has the prime factors 2, 2, 3 and 13. A grid of for example 2*2*3=12 x 13 wells can then be applied (with the two coprime factors being 12 and 13). A "well" is defined as one building block and its height refers to the actual height of the block.

Updates (April 2nd, 2013):

- The timeout issue has been resolved! The script is now able to calculate diffusers of very large sizes.
- I also removed the requirement of _least_ primitive root numbers, because I could not find a reference to that in the patent paper (see abstract).

- By the way, if you like this script, I'd appreciate your support via the like button on my facebook page :-)