Ontogenesis and phylogenesis in the passage from arithmetic to algebraic thought