>>14145790If you take a number you can test if it's inside the Mandelbrot set (inside the black region). This is the formula for 30 "iterations." Iteration is basically the same formula looped back to itself like you can see.
a = ((((((((((((((((((((((((((((c^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c)^2 + c
Here the 'c' is a complex number. If the absolute value of 'a' is less than 2, that puts it inside the black region of the Mandelbrot set. If it is greater than 2, adding more iterations will make it exponentially larger which means it's not inside the set. The Mandelbrot set is basically the region of points 'c' for which the absolute value of 'a' stays below 2 with infinite iterations.
For example, if you plug in the number c = -0.1634+1.0978i, it gives a = 0.0117735... So this point is inside the Mandelbrot set by definition. If you try a slightly different number like -0.1623+1.0975i, this gives a = 10^1266, so it's already growing exponentially which means this number is not inside. If you do this for millions of points and use thousands of iterations you get the cool computer graphics. The pixels other than black are always outside the set; the color is decided based on how quickly the number grows bigger as you add more iterations.
So it all boils down to basic math operations like adding and multiplying.