The rankup.modpi package contains classes implementing the lazy rank updating method to enumerate adjacent modes using residue arithmetic, modulo a large 32bit integer prime number, typically 32,749, the largest prime below √(Integer.MAX_VALUE/2).