I think maths is pure logic, an abstraction of basic truths. Like if you put two things in a bag, and put three more things in there, there are now five things in the bag. I don't think there are other valid answers. Can you explain what about it makes you think it's a form of philosophy?
The intuitionists argue that mathematics precedes logic, whereas Hilbert and his followers (their position being Platonism today) argue as you do (mathematics has its roots in logic).
Both branches of mathematics disagree on basic logical principles (for a Platonist "A or Not(A)" is universally true, but for an Intuitionist it is provably false in some instances). This leads to simple properties such as trichotomy on the reals (given any number, it is <0, =0, >0) failing for intuitionism but being valued for the Platonist.
Godel's incompleteness essentially tells us we can never know which position is "the right one", as no system can prove it's own consistency (i.e no system can ensure itself will never lead to a false result).
Both are acknowledged as consistent systems with respect to one another within academic journals. It is very much a matter of philosophy as to which one is accepted as true.
If you put two things in a bag, and put three more things in there, there are now five things in the bag. I don't think there are other valid answers.
Math starts from that basic simple assumption. Then it can slowly dog-paddle into the weird end of the pool that blurs the line into philosophy or epistemology.
"If I have five things in the bag and I cut one in half, do I now have six things in the bag? What if cut one of them infinity times? Are there any exceptions in which two plus three may NOT equal five or fifteen times twenty may NOT equal three hundred? In either case, how do I prove it? Can I prove it in 24 dimensions?"
But yeah, even when exploring new math, it's still like a numerical story that's writing itself, as if the mathematician is taking dictation, as opposed to making stuff up, because then the math doesn't work.
If Newton and Leibnitz had not come up with calculus, somebody else would have, and sooner rather than later, conditions were ripe for a tool exactly like calculus to be useful. And it would have ended up looking exactly the same.
Is this ALWAYS the case? Is there any math that is purely creative? Can there be any math like this? Maybe the academic world is rife with this sort of thing, and I simply don't know about it.
Math doesn't care about your point of view. Math prevents options (you have count=6 carrots but the length is unchanged), philosophers argue about which one is "more true".
If you cut one in half then mathematically you have 2 1/2 apples. Or 2 0.5 apples. Which still equals one apple. I get where you're going with this, and it does actually make more sense with deeper math to an extent, but I also do kind of agree with the others that generally it's not that deep in math.
I would say math and science are a little more linked. Like "Can we do this?" Test it. You have a hypothesis, so try and find out if you can. That's basically the scientific method, but just using numbers and trying to find an answer.
But as I was finishing that last part, it made me question if I'm getting philosophical about math and what it is... so maybe?
Math is generally pure logic, but based upon arbitrary rules or unproven assumptions. In your example you assume the bag is empty and that it can hold at least 5 things.
For example, Euclidean geometry is based on the concepts of points, lines, and planes. All of those are assumed to exist as defined with no proof.
In a similar vein, philosophy generally defines a base assumption as true and works from there to form a framework.