# Ibn Hamza al-Maghribi

Alī ibn Walī Ibn Hamza al-Maghribi (Arabic: علي بن ولي بن حمزة المغربي), also known as Ibn Hamza Al-Gaza'iri was a 16th-century Algerian mathematician. He was born between 1554-1575 in Algiers in Ottoman Algeria and died around 1611, during the rule of Murad III.
His most important work was Tuhfat al-a'dad fi-l-hisab (The Ornament of Numbers), which discusses some form of the concept of the logarithm.

## Biography

Ibn Hamza was born in Algiers during the 16th century to an Algerian father and a Turkish mother. He studied and memorized in his youth the Quran and a large part of the hadiths, while showing great talents in mathematics. When he reached the age of twenty, his father decided to send him to Istanbul to his maternal family to study mathematics with scholars in the capital of the Ottoman Empire. He thus spent part of his life in Istanbul during the reign of the Ottoman caliph Mourad III, where he quickly became one of the experts in the accounts of the Ottoman Diwan. His dual command of the Arabic and Ottoman Turkish languages also enabled him to teach children of Istanbul schools.
Ibn Hamza remained in Istanbul until the death of his father, when he resigned from his post to return to Algiers in order to take care of his widowed mother. Once in Algeria, Ibn Hamza worked in his father's stalls for some time before deciding to resell them all as well as the family house to move with his mother to Mecca to make his Hajj pilgrimage and subsequently settle in the city.
In Mecca, Ibn Hamza stood out for the mathematics lessons he provided to pilgrims. At that time, Ibn Hamzah mainly focused on teaching mathematical problems and tools that can serve pilgrims on a daily basis, including mathematical problems and games that revolve around questions of heritage. During his stay in Mecca, during the Hijri year 999 (1591), his main work, a 512-page treatise on mathematics entitled Tohfat al-a'dad li-dwi al-rusd we-al-sedad (literally in Arabic: The treasury of numbers for those with reason and common sense) and written mainly in Ottoman Turkish (despite a title in Arabic). Ibn Hamza refers at the beginning of his book to the mathematical treatise "Al-ma'ûna" by Ibn al-Hâ'im (1352-1412), he also thanks and cites many authors in his work, including Sinan bin Al-Fath, Ibn Yunus, Abu Abdullah bin Ghazi Al-Mankisi Al-Maghribi, Al-Kashi, Naseeruddin Al-Tusi, Al-Nasawi and many other mathematicians.
When the Ottoman governor learned of the various works of Ibn Hazam in Mecca, he offered him to work in Diwan Al-Mal, a position he would hold for about fifteen years. He died around 1611.
It is possible that Ibn Hamza's work had some success and circulated as far as Egypt, where two copies are still preserved in Cairo today. However, the fact that he writes his work in Turkish and not in Arabic means that the latter quickly fell into oblivion before being rediscovered by the Turkish epistemologist and mathematician Sâlih Zekî, in 1888 by chance when the latter bought from a Istanbul Grand Bazaar bookseller an old copy of Ibn Hamza's manuscript. Sâlih Zekî first disseminates the hypothesis of the discovery of logarithms by Ibn Hazam by analyzing his copy of Ibn Hamza.

## Works
### The invention of the logarithm

According to a historiographical tradition widespread in the Arab world, his work would have led to the discovery of the logarithm function around 1591; 23 years before the Scottish John Napier, notoriously known to be the inventor of the function of the natural logarithm. This hypothesis is based initially on the interpretation of Sâlih Zekî of the handwritten copy of the work of Ibn Hamza, interpreted a posteriori in the Arab and Ottoman world as laying the foundations of the logarithmic function. Zekî published in 1913, a two-volume work on the history of mathematical sciences, written in Ottoman Turkish: Âsâr-ı Bâkiye (literally in Turkish: The memories that remain). where his observations on Ibn Hamza's role in the invention of logarithms appear.
Indeed, in his work, Ibn Hamza establishes a correlation between numbers in geometric progression and numbers in arithmetic progression, a correlation which would be a clue to think that he would have probably understood the notion of logarithm. These few lines on Ibn Hamza will quickly find an important distribution in particular in the work Science among the Ottoman Turks of Abdülhak Adnan Adıvar which affirms that, if Ibn Hamza had started the study of the progression by the 0 instead of 1, he could have managed to invent logarithms.
In the Arab world, Qadrî Hâfidh Tûqân (1911-1971), professor of mathematics and Palestinian politician, published a book Turâth al-'arab al-'ilmî fî al-riyâdiyyâtwa al-falak (in Arabic: The scientific heritage of the Arabs in mathematics and astronomy), a work published in an Arab nationalist framework. He takes up the Turkish theses of a conceptualization of logarithms by Ibn Hamza. George Sarton, reading this work, writes that "the idea of comparing and juxtaposing arithmetic and geometric progressions had occurred to many Western minds, (but) that from this comparison to logarithms there was still a very large ditch (it seems small to us who know logarithms, but was very large for those who had yet to invent them) ”.
It is nevertheless useful to underline that the majority of the commentators of this controversy (Tuqân, Sarton, Hartner ...) did not however have access to the initial text of Ibn Hamza, which does not prevent these analyzes of texts and these second-hand observations to experience an accelerated dissemination in books and encyclopedias in recent years.
Pierre Ageron, studying superficially8 a copy of Ibn Hamza's manuscript in Ottoman Turkish, kept at the Süleymaniye Kütüphanesi library, and dated to the Hijri year 1013, highlights an example linking geometric progression and arithmetic progression: the first written in oriental Arabic numerals (۱ ۲ ٤ ۸ ۱٦ ۳۲ ٦٤ ۱۲۸), and the second in alphabetical numbers (ا ب ج د ه و ز ح). In the margin is a figure which gives two graduations of the same segment: a regular one above, and a "logarithmic" graduation below. But, for the latter, the use of alphabetic and therefore whole numbers suggests that Ibn Hamza did not think of inserting non-integers and no approximate logarithm calculation is recorded in the manuscript9. Nevertheless we can note that, in the text in Ottoman Turkish, where Pierre Agero identifies the Arabic words us (exponent), dil'ayn (two sides) and a series of powers of 2 in oriental Arabic numerals and that of the corresponding exponents in numerals alphabetic, he was unable to read the actual text of the book because he did not master Ottoman Turkish.

### The eighty-one palm problem

   “ A father dies leaving eighty-one palm trees to his nine sons. The first palm produces one pound of dates a year, the second produces two pounds, and so on until the eighty-first. How do you divide the palms among the heirs so that everyone benefits from the same number of trees and the same annual harvest of dates? "
His treasure of numbers is known in Egypt and notably famous for the "problem of the palm trees", posed by an Indian scholar who was named Mollah Muhammad on the occasion of the great pilgrimage to Mecca in the year 998 of the Hijrah. (1590) to Ibn Hamza. This problem can be solved by means of a magic square of order n, the properties of which were still known in the Muslim world at the time as shown in the treatise drawn up by the Egyptian Muhammad Shabrâmallisî in the 17th century. But this was not the solution proposed by Ibn Hamza who proposed several that he would later integrate at the end of his future book under the name of the problem of Mecca.