public virtual int Rank0(int pos) { // pos + 1 = Rank0(pos) + Rank1(pos) return pos + 1 - this.Rank1 (pos); }