Q:

$AAAPPPLMNOOXQSDF$ number of anagrams such that there aren't three consecutives letters that are the same

$AAAPPPLMNOOXQSDF$
I would like to calculate thenumber of anagrams such that there aren't three consecutives that are the same.  
Yet I don't really know how to proceed any ideas ?  

A:

First find that there are $\frac{16!}{3!3!2!}$ anagrams, then subtract those having consecutive $A$'s.  You can calculate their number pretending that the three $A$'s are a single letter.  So $-\frac{14!}{3!2!}$. Do this again for the $P$'s.  But this way you have subtracted twice the anagrams having both $A$'s and $P$'s grouped, that have to be added in back: $+\frac{12!}{2!}$. All in all:
$$\frac{16!}{3!3!2!}-2\times\frac{14!}{3!2!}+\frac{12!}{2!}$$

