[style option] One could shorten ```math.pow(2, i).toLong``` to ```1L << i```