Ahrens then spent a year teaching at the German School in Antwerp, before returning to university for a further year. It was this brief spell at the University of Leipzig, under Sophus Lie, which inspired his later work in group theory such as Zur Theorie der adjungirten Gruppe (1897) and Über eine besondere Klasse von Substitutionsgruppen (1897). It also led to him writing about Lie as a teacher in 'Sophus Lie' als Pädagog (1900). After these university studies, Ahrens was employed at the School of Architecture for four years and later at the School of Mechanical Engineering in Magdeburg for three years. He left, upon fearing that he might be relocated to a smaller town, when the School was municipalized in 1904.
Giving up his career as a teacher, Ahrens relocated to Rostock as an independent scholar, in order to pursue his literary work. His skill in chess gave him a strong interest in mathematical games and entertainment, as evinced by his 23-chapter, 2-volume book Mathematische Unterhaltungen und Spiele , published in 1910. This book showed that Ahrens had an exceptionally thorough knowledge of the surrounding literature. One interesting aspect of this book is the historical notes associated with the games and another interesting aspect is that he explains the relationship of the games to topics in pure mathematics, in particular to number theory, group theory, combinatorics and topology.
This two volume work was, in fact, a second edition of the 454-page single volume work Mathematische Unterhaltungen und Spiele (1901). He had written this book to make available a German language work similar to the French book by Édouard Lucas, Récréations mathématiques , and the English book by Walter Rouse Ball, Mathematical Recreations. One of the features of Ahrens' book, which distinguishes it from other similar books of the time, is that it is written for those who have some mathematical background and, consequently, he only looks at games which are mathematically interesting. In 1907 Ahrens published Mathematische Spiele which was a shorter (only 118 pages) and much more elementary text on games which was intended to be instructive and entertaining reading for everyone. If number of editions is a good guide to popularity then, not surprisingly, it was this elementary text which sold the most copies. It ran to five editions, the fifth being published in 1927. Ahrens did make changes to the book over these twenty years expanding the chapters on magic squares and on mathematical fallacies. However, he made sure that the book did not grow bigger by shortening other chapters. The two volume Mathematische Unterhaltungen und Spiele ran to two editions, the second expanded and improved edition was published in 1918.
Due to his expansive knowledge of the background literature, gained through investigating very old sources and picking out the fundamental mathematics from these works, Ahrens was also asked to write an article about mathematical games for Felix Klein's encyclopaedia Enzyklopädie der Mathematischen Wissenschaften ; he contributed the 14-page article Mathematische Spiele which was published in 1902. Another interesting work by Ahrens is a valuable collection of quotes about mathematics and mathematicians Scherz und Ernst in der Mathematik, geflügelte und ungeflügelte Worte , published in 1904. Here are some examples from the book :-
"Geometry is the only science which has produced no sects" (Frederick the Great).
"D'Alembert, that great genius, seems to be far too ready to pull down everything he has not himself built up" (Euler to Lagrange).
"I am delighted at the contrast between your modesty and the good opinion that other geometers have of themselves, although they have certainly nothing like the same claim. You are a living instance of what you said to me some time ago, that pretensions are ever in an inverse ratio to merit" (d'Alembert to Lagrange).
"Leibniz never married. At the age of 50 he began to think about it, but the lady asked for time to reflect. This gave Leibniz time to reflect - and he did not marry". (Fontenelle).
"My dear and illustrious friend - they write to me from Berlin that you are about to take what we philosophers call 'le saut perilleux,' and that you have married one of your relations. ... Accept my compliments, for a mathematician ought to have pre-eminent advantages in the calculations of his own happiness, and any calculations of yours are sure to lead to a solution - the solution in your case being marriage" (d'Alembert to Lagrange).
F Müller writes in a review of Scherz und Ernst in der Mathematik:-
The author has gathered, with great diligence, interesting expressions of mathematicians and about mathematics and mathematicians, and these well-known and less well-known words are classified according to their content, though not strictly systematically. The sources from which the author has drawn are very carefully specified. Ahrens has understood, just to select those utterances of an author, which are characteristic of his position, his mindset, and his individuality. And so, supported by a carefully crafted index of names, we learn to know better the personality of many mathematicians whose works we have studied. That many trivial and even tasteless sayings are found among many witty ones in this work, is self-evident. ... Unfortunately, you will be reminded in several quotes that anyone can be a great mathematician and yet be a very uneducated person. The book still offers an abundance of Interesting and enjoyable amusements.Of particular interest to the history of mathematics is the book Briefwechsel zwischen C G J Jacobi und M H Jacobi, which published the correspondence between the Jacobi brothers. This correspondence was between the mathematician Carl Jacobi and his brother Moritz Hermann Jacobi (1801-1874) who was an electrical engineer. Although Moritz Jacobi was born in Potsdam, he spent most of his life in Russia where he was known as Boris Semyonovich von Jacobi. Ahrens heavily annotated the work, published in 1907, in order to make the correspondence accessible for readers of his day.
In 1908, Ahrens, in collaboration with Paul Stäckel, published Briefwechsel zwischen C G J Jacobi und P H von Fuss über die Herausgabe der Werke Leonhard Eulers , making available letters between Carl Jacobi and Nicolaus Fuss concerning the publication of Leonard Euler's complete works. Euler was born in 1707 and the work by Ahrens and Stäckel was associated with the bicentennial of his birth.
Following critical investigation of old sources, Ahrens wrote Mathematiker-Anekdoten (1916) which is of particular interest for the study of mathematical history. In it he looked at the mathematicians Adam Ries, Pierre Fermat, Leonard Euler, Carl Friedrich Gauss, Joseph-Louis Lagrange, Augustin-Louis Cauchy, Bernhard Riemann, K H Schellbach and Hermann Grassmann. He states that his aim in writing the work is to provide students in the upper classes of middle schools stimulating and instructive reading material that illuminates the development of mathematics and the lives of its researchers. Emil Lampe (1840-1918) writes in a review that Ahrens, as the author of Scherz und Ernst in der Mathematik, is able to select well chosen material from the wealth of its treasures about a number of mathematicians.
In addition to these books, let us give some indication of papers that Ahrens wrote. In 1901 and 1902 he published mathematical chess puzzles; for the 100th anniversary of Carl Jacobi's birth in 1904 he wrote a biography; in 1905 he published a paper on Peter Gustav Lejeune Dirichlet; in 1906 he published letters between Carl Jacobi and his brother Moritz Jacobi concerning Carl Jacobi's unsuccessful attempt in 1848 to become a member of the National Assembly; also in 1906 he published a paper on Jacobi and Steiner; in 1908 he published sketches from the life of Weierstrass; he also wrote several papers discussing whether Euler's works should be published in German or Latin; in 1914 he wrote a couple of papers on one of his favourite topics, namely magic squares, and in the following year on the magic square in Albrecht Dürer's painting Melancholia.
Though he had many other literary ideas, his death prevented their implementation. By all accounts Ahrens had an amiable nature and was a loyal friend. The author of  writes:-
His colleges in Rostock will not only remember him as an inspiring companion in all scientific questions, but also as a loyal and constantly happy to help friend.
Article by: J J O'Connor and E F Robertson