// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class Bits {
    public static long bits(int n) {
        return ~(-1L << n);
    }
    public static long bits2(int n) {
        return (-1L >>> (64 - n));
    }
    public static void main(String[] args) {
        for(int i = 0; i <= 64; i++ ) { 
            System.out.println(i + " " + bits(i));
            System.out.println(i + " " + bits2(i));
        }
    }
}
