IBM Interview Question

Solve a fizzbuzz variant, match output exactly to given test cases.