What are the fractal patterns produced by coloring according to digit sums of coordinates?

75 Views Asked by At

I recently encountered something odd and I was wondering if anyone have seen something like it before, and could possibly explain what is going on.

Given a coordinate system, for each xy coordinate within that system apply some function f: f(x,y) = Z. For the result, sum the component digits and use that sum to place a specific color at that xy coordinate.

With variations of this, you get these types of results:

If f(x,y) = and(x,y), i.e. bitwise AND, then the resulting image looks something like this: https://i.stack.imgur.com/989cB.png

If f(x,y) = or(x,y), i.e. bitwise OR, then the resulting image looks something like this: https://i.stack.imgur.com/2LiHC.png

If f(x,y) = mul(x,y), i.e multiplication, then the resulting image looks something like this: https://i.stack.imgur.com/GseMy.png

If f(x,y) = xor(x,y), i.e. bitwise XOR, then the resulting image looks something like this: https://i.stack.imgur.com/bDLi5.png

If f(x,y) = add(mul(x,x), mul(y,y)), i.e. (xx) + (yy), then the resulting image looks something like this: https://i.stack.imgur.com/T0RVe.png

Here is a sketch that shows different aspects of this behaviour: https://www.shadertoy.com/view/tlBGDV

I hope someone has seen this before and can talk about it a little bit.