Hello, can someone help me with this.

A man is to receive six payments of $500 each, the first payment in a year's time and subsequent payments at two-yearly intervals. He invests each payment at 9 per cent per annum. How much will he have immediately after the last payment is made. Answer is $4818

and

A firm is established with new equipment and creates a fund to provide for the replacement of the equipment after 6 years at an estimated cost of $20 000. How much should be paid into the fund anually if interest at 11 % can be obtained. Answer is $2528

Can someone help me derive the equations...? I know how to do the rest. Thanks