>>13274140both, like every activity on earth. Everything is interconnected. The intuition that helps us write cooking recipes is what enabled us to invent algorithms, functions, and so on. The intuition of counting, which is psychological in nature (you can instantly identify clusters of 3-5 objects and think of them as a number, without counting one by one) enabled us to do other things too, like algebra.
>>13274156people didn't invent counting. Even babies and stupid animals can instantly identify clusters of objects. Even bees can count. If you give two monkeys the same task, and then reward one monkey with 1 fruit and then give 2 fruits to the other, the first monkey will instantly know it's not fair and freak out.
I wish I could punch to death all these stupid STEMfags who think science is something that's separate from human knowledge. Bro, even quantifiers in math were invented. Hell, they're a fucking recent invention at that. First order logic is a recent invention too. Even simple logic is recent (2000y ago, by Aristotle).