Bond/Liability Immunization

What is the pattern (formula?) for immunizing 3 liabilities in 3 years with 1 year, 2 year, 3 year coupon bonds?

Something like “buy the 3 year, discount it back one year and subtract the 3rd year coupon, then buy the 2nd year bond, subtract the 2nd year coupon from the 2nd year bond and the coupon from the 3 year bond, etc.”

I can’t find the problem right now, but I feel like this is something that could come up on the exam.