Comment by croes
But science is based on empirical methods.
Math isn’t empirical. You don’t do experiments in maths do gain knowledge.
It’s not a natural science and not a social science so that leaves formal science but math in a requirement for formal science. Math can’t be its own requirement so it’s not a formal science either.