Product matrix of reduced residues (rings). Recursive. The patterns you see are the deep structure of the algebraic space of N. (Used Java but that was an arbitrary choice).
Sorry, assumed you would google it. Basically, let say you have a set of numbers {1, 2, 3, .., n}. And you remove all numbers -- except 1 -- in that set that have a common factor with n. example {1, 2, 3, 4, 5, 6} => {1, 5}. So {1, 5} is the reduced residue set of 6. And lets call the product of all primess up to a certain prime as a primorial. (This is just like a factorial, except that we only multiply primes in the range. So, 6 is a primorial since it is 2 * 3. Now just make a multiplication matrix with that r.r.s. and enter the product of the x and y mod the primorial. That matrix is what is generating those images.