Previous to you tax dollars and philanthropy have funded math in various forms and you reap the benefits.
You funded it before with your tax dollars, and it was already a hobby at this point. Mathematicians do what they do because it is fun. Well-paid-for fun, if they were able to get tenured.