question: @ Override public int [ ] unrank ( ) { if ( k == 0 ) return new int [ 0 ] ; int [ ] combi = new int [ k ] ; long rank = count - 1 - currentIndex ; long e = ( n - k ) * count / n ; int t = n - k + 1 ; int m = k ; int p = n - 1 ; do { if ( e <= rank ) { combi [ k - m ] = n - t - m + 1 ; if ( e > 0 ) { rank = rank - e ; e = m * e / p ; } m -- ; p -- ; } else { e = ( p - m ) * e / p ; t -- ; p -- ; } } while ( m > 0 ) ; return combi ; }
target:  This implementation uses the UNRANKCOMB-D algorithm introduced in: Kokosinski, Zbigniew, and Ikki-Machi Tsuruga. "Algorithms for unranking combinations and other related choice functions." (1995).