The T.M. Raghunath calendar is based on the Gregorian calendar, however it aims for a more precise average year length (365.2425 days for Gregorian).
The target year length is 365.2422 days.
With the four-year leap cycle, the error is 365.25 - 365.2422 = 0.0078 day per year.
After 124 years, the error is 0.0078 x 124 = 0.9672 day. That amounts to almost one full day so a leap year can be skipped, which makes it a 128-year leap cycle.
For a smooth distribution the 128-year cycle can be divided into 33-year subcycles, which means leap year 28 is followed by leap year 33 instead of leap year 32 (five-year interval). Leap years 33, 66, 99 and 128 of the cycle have a five-year interval.
The fractional part of 365.2422 x 128 is 0.0016 day which is the residual deficit of the 128-year cycle.
After five cycles or 640 years, the residual is 0.008 day which is almost the same as the 0.0078 day per year error of the four-year leap cycle.
After 39 cycles or 4992 years that residual becomes 0.0016 x 39 = 0.0624 day. That is the same as the error in eight years of the four-year leap cycle: 0.0078 x 8 = 0.0624 day. So by following the four-year leap cycle for eight more years we obtain a 5000-year leap cycle with 1211 leap years and the target year length average of 365.2422 days.