we have two cases that is
1) when the last outcome is head then the outcome of the n-1 th toss shud be a tail and then we shudnt have ne consecutive heads or tails from 1 to n-2 th toss
2)when the last outcome is a tail then we shud have no consecutive heads in previous tosses
P(A)=p(1-p)pn-2+(1-p)pn-1