The association of math (or number) with philosophy (or religion) was already an accomplished fact at the beginning of known history. The creation myths were full of "sacred" numbers - the simplest of these being 1, 2, 3, 4, 5, 7 and 12 - to such an extent that the philosophy of numbers had its own name - numerology - and attached specific philosophical meaning to 1) all the basic counting numbers 1 to ten; 2) the sexagesimal numbers (the Babylonian base-60 system) including all the prime factors of 12 and 360; 3) "doubled digit" numbers such as 11, 22 and 44; and 4) many of the products of multiplication of these numbers. Pythagoras famously taught "all is number" as the core of his philosophy.
Everyone is familiar with the ancient importance of 7 because it was made the number of days in a week, which conveniently divided the time of one moon, from "new moon" to "full" and back to new, into four "quarters" of about one week each. Remarkably, the week is a peculiarly useful time period; one can observe in astronomy publications even today how many astronomical observations of the planets and other repeating phenomena in our solar system are so often expressed in weeks - it appears to be not only traditional, but in accordance with the observed facts and thus with the need of modern science for precision. The most basic such observation, after the approximate 4 weeks per month, would be that there are 52 weeks in the year, and 13 weeks in each of the seasons. Note that this is not exact: 52 weeks of 7 days is 364 days, about 1 day short of the actual year, but that discrepancy has not weakened the use of 52 weeks for the year since primitive times, up to the present. The orbital periods of all the anciently known planets except Mercury differ from a whole number of weeks by about 1 day: Venus=224.7 days (32x7=224); Mars=687 days (98x7=686); Jupiter=4331.8 days (619x7=4333); and Saturn=10,760 days (1537x7=10,759). And - the difference between the sidereal and synodic periods of Mercury is 27.9 days, almost 4 weeks exactly. The next time you see an astronomy magazine, look up the monthly events and see how often the duration of these events is expressed in weeks; the reason is, it works so well, so often.
The earliest philosophers were already aware of the recurrence of certain numbers in observations of the natural world, and the thesis that these numbers were expressions of the literal design of everything by a divine Creator. We have a base-10 numbering system today because we have 10 fingers to count on, and 10=2x5: The number 5 was sacred in the ancient earth religions - which early-on worshipped the Goddess rather than God - and the 5-pointed star, or pentagram, was the symbol of the Pythagoreans. 5 occurs frequently in nature, beyond the example of our own fingers and toes - the starfish, for example; the arrangement of 5 stems around a central apical stem in pine trees; the arrangement of apple seeds inside the apple when cut through crosswise (at right angle to its central axis), and so on. On a more subtle level, and even more widespread, the number 5 has close association with the celebrated "golden mean," or "golden section" (which will not be elaborated here, because it is definitely mathematical), and the golden mean is manifested in the geometric growth patterns of many living things (such as in the successively larger chambers in the growth of the chambered nautilus). The pentagram (of the Pythagoreans, remember) also embodies a repetition of the golden mean in its lines and their divisions.
If the 7-day week is nearly ubiquitous in the natural periods of the planets and other local astronomical phenomena, the number 12, and its particular multiples 24, 60 and 360, recur in measurements on the earth and sky, and in our measurement of time. There are 24 hours in a day; there are 12 hours on the face of our clocks and watches; there are 60 seconds in a minute, 60 minutes in an hour, and the full circle encompasses 360 degrees. More subtly, like the planets there are uncanny instances of naturally occurring numbers near, but not exactly, some multiple of 24: The circumference of the Earth is about 24,900 miles, and the Earth's spin axis is tilted about 23.5 degrees from its orbital axis (which gives us our seasons, as the northern hemisphere is tilted toward the Sun in the summer, and away in the winter). Mars too is tilted in its spin almost 24 degrees with respect to its orbit, just like the Earth. The Moon is roughly 240,000 miles from the Earth, or 10,000x24 miles.
The ancients knew many of these things, and knew they betokened deep, philosophical meaning. From their many careful observations of number came the establishment of the idea of strict mathematical order in the phenomena of the natural world, which still claims the central place in science thousands of years later. Science indeed runs by faith in such order, and in our ability to penetrate it for its various causes, in basic laws and material forms. Number is, as Pythagoras taught so long ago, the core of science and philosophy concerning our amazing physical universe.