The paper considers an approach to mathematical education adequate to the task of developing mathematics and its applications in the XXI century. This approach is based on improving the efficiency of the educational process by maintaining the motivation of students of various categories. The basis for the formation of motivation is, on the one hand, independent design, invention of mathematical objects, methods of action and models of the world around us, the discovery of facts of mathematical reality. On the other hand, it is solving of new, unexpected, feasible tasks for the student. In the described perspective, the student’s work is similar to the work of a mathematician-researcher and programmer. The possibilities of research activity in educational mathematics are significantly expanded due to computer-based intra-mathematic experiment. A special kind of mathematical experiment is debugging a computer program.