The sponsored guys master web programming, in particular, PHP.
One of the first tasks for mastering the <table> tables is that they are given the task of rendering the multiplication table in PHP, 25x25.
Further simple “frills” begin - for example, to paint cells with even numbers in the resulting table. As it turned out, you can enjoy the bells and whistles for hours.
It is expected to see the criterion for selecting the cell to be painted as something like
... if (($x * $y) % 2 == 0) $color = "red"; else $color = "white"; ...
at the output we get something like

')
Funny cell coloring can be obtained by replacing 2 with another number.
Here is for% 4 (I’ll leave% to emphasize that the check of the remainder of division is used)

Here is for% 5

For prime numbers, we get a “cage” with a size corresponding to a number, for composite numbers, a rather funny pattern.
For example, for% 21

For even numbers, the pattern diligently tries to pretend to be a circle, or to be exact - concentric circles - for example, for% 24

The image is stretched horizontally - because all the same numbers the further, the greater.
It becomes clear that the multiplication table itself has already become less interesting, so we will draw an image in which 1 pixel will correspond to one cell of our table, and the color will correspond to the selected condition.
In this case, you can significantly increase the size of the table:
For example,% 720 (6! = 1 * 2 * 3 * 4 * 5 * 6) And what if the condition is not cut off according to the criterion of division, but according to the criterion of the remainder, not exceeding a certain value?
it looks like this ($ x * $ y)% 720 <72 Already looks like a carpet. But for greater similarity will have to perform this operation:
((($ x * $ y)% K1)% K2) ...% Kn)
It is logical that the coefficients should decrease with increasing n, otherwise there will be no special benefit from the operation - the series will degenerate to a shorter one.
this is what ($ x * $ y)% 677% 255% 71 <13 looks like Of course, the carpet should be colored. The main thing here is not to overdo it with the number of colors.
As a result, something like this was done:
Some amount of PHP code <?php $max=rand(500,800); $k1=$max; $k2=rand($k1/10,$k1); $k3=rand($k2/10,$k2); $k4=rand($k3/10,$k3); header("Content-type: image/png"); $image = imagecreatetruecolor($max,$max+20); $black = imagecolorallocate($image,0,0,0); $cr=rand(0,255); $cg=rand(0,255); $cb=rand(0,255); $dr=0; $dg=0; $db=0; for ($i=0; $i<$k3;++$i) { $cl[$i]=imagecolorallocate($image,rand(0,255),rand(0,255), rand(0,255)); } for ($y=0; $y<=$max; $y++) { for ($x=0; $x<=$max; $x++) { $mux = $x*$y; $rest = $mux%$k1 %$k2 %$k3 %$k4; imagesetpixel($image,$x,$y,$cl[$rest%5]); } } imagestring($image,3,20,$max,"K1=$k1, K2=$k2, K3=$k3, K4=$k4",imagecolorallocate($image,255,0,0)); imagepng($image);
which draws carpets:
The Gaussian Blur carpet is especially good at about 2.5 pixels.
