The origins of mathematics