in reply to Substitution on a sequence

What bit are you having trouble with? What have you tried already? Can we see some (short) code?