If you want to find out if a month is Male (30 days ) or Chaser ( 29 days ). Start counting from Nisan and the month number plus the number of days in the month will always be odd, like a parity bit
Nisan(1) + 30 = 31 //odd
Iyar(2) + 29 = 31 //odd
Sivan(3) + 30 = 33 //odd
...
This works for a regular, Kseder year.
For a leap year, Adar 1 is 30 , and Adar 2 is 29, so here you can find the length of Adar n, by using a modified parity bit rule.
Adar (1) + 30 = 31 //odd
Adar (2) + 29 = 31 //odd
The only thing this doesn’t cover is Chesvan and Kislev, because they change depending on if the year is Male or Chaser, and that is a much more complicated calculation.