@elgin , some simple maths can go without writing such as addition, subtraction, multiplication, and division. Fields such as accounting, business, engineering, construction, chemistry, navigation, and astronomy all of which require math likely existed before writing. Mathematical concepts expressed in games, gambling, and puzzles existed before writing.
Farming likely existed before any writing. In my opinion, writing evolved out of those fields instead of the other way around. Writing may have also evolved out of artistic expression. Humans were drawing, painting, and chiseling on rocks, the ground, and leaves before any true writing existed. They were artistic expressions that may have played a role in the development of writing. I'm no expert, but Chinese writing might have evolved from a more visual expression of their language. Some of the characters visually represent their meaning.