This paper presents a theoretical framework for investigating the role of algorithms in mathematical thinking. In the study, a combined ontological-psychological outlook is applied. An analysis of different mathematical definitions and representations brings us to the conclusion that abstract notions, such as number or function, can be conceived in two fundamentally different ways: structurally-as objects, and operationally-as processes. These two approaches, although ostensibly incompatible, are in fact complementary. It will be shown that the processes of learning and of problem-solving consist in an intricate interplay between operational and structural conceptions of the same notions.