Abstract Nowadays, algorithmic thinking is considered to be one of the key competences of students from primary to higher education. In our paper we point out the possibility of alternative methods of teaching algorithms. We deal with the concept of algorithm, problem analysis and algorithmic thinking. We search for such tasks that motivate and mobilize students to seek the essence of the task first impression of which is mystique. They raise the curiosity and desire to uncover the mystery as they are based on the principle of black box. Particular topics are same in Mathematics as well as in Computer Science which enables the usage of cross-curricular activities. We focus on numerical sequences, codes, ciphers, algebraic riddles and puzzles based on the principle of positional systems. In the paper, we present the tasks that can be programmed, but it is also important to know the basic, often very simple, mathematic relations. The mentioned tasks were presented mainly within various teacher trainings and educational workshops where they provoked a very positive response and managed to activate the teachers themselves.