computes delta and gamma codes of integers