M'Aiq is right (as always
):
The number after the name does in no way imply direct descendance or even blood relationship - the most striking real-life example being the Catholic popes, who are by definition very rarely related to each other, but go all the way down to John XXIII or Benedict XVI (both spanning c. 1400 years from the first of their name).
It's just a way to distinguish rulers with the same name.
As its often the custom to name a son after his father, grandfather or renowned ancestor, or on accession to assume a throne name that follows this custom, some names are often connected to certain dynasties, but you usually can't deduce relationship from shared names.