how do i generate a whole integer from 1 to an upper bound n