The task is to optimize the functions (search for extrema). I chose genetic algorithms as one of the methods of random directional search. Something realized. I would like to share and offer to join . As an example, a simple function and only integer values of the argument are taken. It is necessary to develop an algorithm for use in optimizing more complex functions.