Mathematics history goes back pretty far: the Greeks were studying it in 600BC, the Babylonians and Egyptians all the way back beyond 2000BC, and there's even some evidence of prehistoric mathematics. Calculus was born in the 17th century, and modern mathematics, in the sense I usually hear that term, seems to have started somewhere in the 19th century. There's a lot of time between those intervals.
Was there ever a gap in history where not much mathematics was discovered?

The early dark ages, from 535 to 600 is pretty sparse, because a catasthrophic volcano eruption overturned societies everwhere. You expect that with climate change.
See eg https://en.wikipedia.org/wiki/Climate_changes_of_535%E2%80%93536