for ( my ($bits, $j, @used) = ($i, 0); $bits; $bits >>= 1, ++$j ) { push @used, $n[$j] if $bits & 1; }