Add algorithm to set bit pattern in an integer