sub joe {$n=$_[0];($n==1)? 1:(($n % 2)? 2*joe(($n - 1)/2)+1:2*joe($n/2)- 1)} print "v2: use position " . joe($n) . "\n";