Abu Jafar al-Khazin may have worked on both astronomy and number theory or there may have been two mathematicians both working around the same period, one working on astronomy and one on number theory. As far as this article is concerned we will assume that al-Khazin worked on both topics. There seems no way of being certain which position is correct.
Al-Khazin's family were from Saba, a kingdom in southwestern Arabia, perhaps better known as Sheba from the biblical story of King Solomon and the Queen of Sheba. In the Fihrist, a tenth century survey of Islamic culture, he is described Al-Khurasani which means that he came from Khurasan in eastern Iran.
The Buyid dynasty, ruling in western Iran and Iraq, reach its peak around the time that al-Khazin lived. It undertook public schemes such as building hospitals and dams, as well as patronising the arts and sciences. Rayy, situated southeast of present day Tehran, was one of the major cultural centres of the Buyid dynasty. Islamic writers described Rayy as:-
... a city of extraordinary beauty, built largely of fired brick and brilliantly ornamented with blue faience (glazed earthenware).
Al-Khazin was one of the scientists brought to the court in Rayy by the ruler of the Buyid dynasty, Adud ad-Dawlah, who ruled from 949 to 983. We know that in 959/960 al-Khazin was required by the vizier of Rayy, who was appointed by Adud ad-Dawlah, to measure the obliquity of the ecliptic (the angle which the plane in which the sun appears to move makes with the equator of the earth). He is said to have made the measurement:-
... using a ring of about 4 meters.
One of al-Khazin's works Zij al-Safa'ih (Tables of the disks of the astrolabe) was described by his successors as the best work in the field and they make many reference to it. The work describes some astronomical instruments, in particular it describes an astrolabe fitted with plates inscribed with tables and a commentary on the use of these. A copy of this instrument was made but vanished in Germany at the time of World War II. A photograph of this copy was taken and the article  examines this.
Al-Khazin wrote a commentary on Ptolemy's Almagest which was criticised by al-Biruni for being too verbose. Only one fragment of this commentary has survived and a translation of it is given in . The fragment which has survived contains a discussion by al-Khazin of Ptolemy's argument that the universe is spherical. Ptolemy wrote :-
.. of different figures of equal perimeter, the one with more angles is greater in capacity, and therefore it is necessary that a circle is the greatest of surfaces (i.e. of all plane figures with a constant perimeter) and the sphere the greatest of solids.
Al-Khazin gives 19 propositions relating to this statement by Ptolemy. The most interesting results show, with a very ingenious proof, that an equilateral triangle has a greater area than any isosceles or scalene triangle with the same perimeter. When he tries to generalise this result to polygons, however, al-Khazin gives incorrect proofs. Other results among the 19 are based on propositions given by Archimedes in On the sphere and cylinder. The author of  argues that the ingenious results on triangles are unlikely to be due to al-Khazin but are probably taken by him from some unknown source.
The suggestion in  that al-Khazin is a third rate mathematician is somewhat doubtful given his work on number theory but as we stated at the beginning of this article, it is possible that there were two mathematicians of the same name. The papers ,  and  all look at this number theory work by al-Khazin (see also  and ). The work of al-Khazin which is described seems to have been motivated by work of a mathematician by the name of al-Khujandi.
Al-Khujandi claimed to have proved that x3 + y3 = z3 is impossible for whole numbers x, y, z which of course is the n = 3 case of Fermat's Last Theorem. In a letter al-Khazin wrote:-
I demonstrate earlier ... that what Abu Muhammad al-Khujandi advanced - may God have mercy on him - in his demonstration that the sum of two cubic numbers is not a cube is defective and incorrect.
This seems to have motivated further correspondence on number theory between al-Khazin and other Arabic mathematicians. Results by al-Khazin here are interesting indeed. His main result is to:-
... show how, if we are given a number, to find a square number so that if the given number were added to it or subtracted from it the result would be square.
In modern notation the problem is given a natural number a, find natural numbers x, y, z so that x2 + a = y2 and x2 - a = z2. Al-Khazin proves that the existence of x, y, z with these properties is equivalent to the existence of natural numbers u, v with a = 2uv, and u2 + v2 is a square (in fact u2 + v2 = x2). The smallest example of a satisfying these conditions is 24 which al-Khazin gives
52 + 24 = 72, 52 - 24 = 12.
He also gives a = 96 with
102 + 96 = 142, 102 - 96 = 22
although, rather strangely, he seems to discount this case by another of his statements. Rashed suggests this may be because 96 = 2 × 48 = 2 × 6 × 8 and 62 + 82 = 102is not a primitive Pythagorean triple.
There is a mystery which Rashed notes in  (also in  and ). This relates to the quote above by al-Khazin regarding the false proof by al-Khujandi of the impossibility of proving x3 + y3 = z3. Rashed has discovered a manuscript which appears to be by al-Khazin, yet contains exactly what he had attributed to al-Khujandi. Although al-Khazin could have realised the error in al-Khujandi's proof and attempted a similar proof himself which he believed correct, there is no really satisfactory explanation of these facts.
Finally we should mention that al-Khazin proposed a different solar model from that of Ptolemy. Ptolemy had the sun moving in uniform circular motion about a centre which was not the earth. Al-Khazin was unhappy with this model since he claimed that if this were the case then the apparent diameter of the sun would vary throughout the year and observation showed that this were not the case. Of course the apparent diameter of the sun does vary but by too small an amount to be observed by al-Khazin. To get round this problem, al-Khazin proposed a model in which the sun moved in a circle which was centred on the earth, but its motion was not uniform about the centre, rather it was uniform about another point (called the excentre).
Article by: J J O'Connor and E F Robertson