Jiang Jing (Water Margin)

Jiang Jing is a fictional character in Water Margin, one of the Four Great Classical Novels of Chinese literature. Nicknamed "Divine Mathematician," he ranks 53rd among the 108 Stars of Destiny and 17th among the 72 Earthly Fiends.

Background
Jiang Jing, a native of Tanzhou (潭州; around present-day Changsha, Hunan), is a scholar who has repeatedly failed imperial examinations -- the conventional route to become government official in ancient China. Frustrated and disappointed, he shifts to concentrating on military-related subjects. After years of hard work, he is not just skilled in martial arts but also good in military tactics and numerical calculations. His mathematical talent earns him the nickname "Divine Mathematician".

When he first appears in the book, he is one of the fours chiefs leading the bandit group at Mount Yellow Gate (黃門山), ranked below Ou Peng and above Ma Lin and Tao Zongwang

Joining Liangshan
When Song Jiang is following the outlaws of Liangshan Marsh back to their stronghold after they and some heroes of the Jieyang region saved him in Jiangzhou (江州; present-day Jiujiang, Jiangxi), he comes by Mount Yellow Gate with the group. They are blocked by the four bandit chiefs who demanded to know whether Song is among them. When he steps out to show himself, they come forward to pay homage to him. When they learn that the group is heading for Liangshan, they wanted in and are accepted.

Campaigns and resignation
Jang Jing is appointed to keep accounts of the grain stock, finance and logistics of Liangshan after the 108 Stars of Destiny came together in what is called the Grand Assembly. He participates in campaigns against the Liao invaders and rebel forces in Song territory following amnesty by Emperor Huizong for Liangshan.

Jiang Jing is one of the Liangshan heroes who survives all the campaigns. Though given an official appointment, he quits soon and goes back to his hometown Tanzhou, where he lives as a commoner for the rest of his life.