The Imami scholar and biographer Shaykh al-Najashi (d 450 AH/1058 AD) has recorded the lineage of Abd al-Azim at the beginning of his biography as: Abd al-Azim bin Abdullah bin Ali bin al-Hassan bin Zayd bin al-Hassan bin Ali ibn Abi Talib (A.S) and this is his correct lineage. However, he then writes at the end of the biography: He (i.e. Abd al-Azim) died and when he was undressed so that the funeral bath could be given to him, a small piece of paper was found in one of his pockets in which was written his lineage, as follows: “I am Abu al-Qasim Abd al-Azim bin Abdullah ibn Ali bin al-Hassan bin Zayd bin Ali bin al-Hassan bin Ali ibn Abi Talib (A.S).” But the first rendering of his lineage is correct for Imam al-Hassan’s progeny continued through the agency of two sons, who were:
1) Zayd bin al-Hassan, and
2) Al-Hassan al-Muthanna.
Thus it is apparent that Imam Hassan (A.S) did not have a son by the name of Ali through whom he may have had grandchildren (as the second version of Sayyid Abd al- Azim’s lineage above implies).
Therefore on the basis of the above, Sayyid Abd al-Azim was separated from Imam Hassan (A.S) by four generations only.
Ref: Al-Islam.org