Relative positions in permutation Say we have the following string: $$\text{s=aaaabbcdefghijkl} \tag{1}$$


*

*a) In how many ways can we permute $s$ ($|s|=16$) such that all $4$ a's are spaced by at least 3 spaces relative to another (To clarify: it is sufficient in one direction, e.g. axxxaxaxxxa... each a has at least one other a 3 steps away): (More examples at the bottom).
$$\text{s'=abbcadefaghiajkl}$$
Or
$$\text{s''=abbcadefghiajkla}$$


For case a), my initial guess was that once the first a is placed, the remaining ones have only 1 possibility. So to place the first a we have 13 choices (the 3 extra a's put aside for now), thus overall we have: (notation $n_x$ is used to denote the number x's we have) $$\dbinom{13}{1}\dbinom{12}{n_b}\dbinom{12-n_b}{n_c}\dots \dbinom{1}{1}$$
From the comments, I now realise my attempt above is wrong, since I did not take into account the relation between possible triple-spacing allowed within the size of s.


*

*b) More generally how is the counting done if $s$ has length $k$ and we only require at most $n$ $(n=0,1,...,n_a)$ of the $n_a$ $a$'s to be spaced by $3$ places, and the remaining ones are free to take any place? In other words, e.g. for case $n=1,$ at most $1$ $a$ can be found that has another $a$ 3 spaces away from itself, thus for $n=1$ one such setup of s would be $\text{aaaiabcb}\dots$ (only the first and last one are spaced by 3 from one another, thus n=1 satisfied.)

*If you find the general case is not obvious to solve for, feel free to consider the case b) for example (1).
For simplicity assume s has enough letters other than a's that the case of all a's being $n=m$ can always take place.
If tldr,


*

*The main question is: How to count the number of ways $s$ can be permuted such that at most $n$ $a$'s see  (either to left or right) another $a$ 3 steps from themselves? (where $n=1,2,\dots, n_a$)



Further examples for case a): axxxaxaxxxaxxxxx, axxxaxxxaxxxaxxx, xaxxxaxxxaxxxaxx, xxaxxxaxxxaxxxax, xxxaxxxaxxxaxxxa, axxxaxxxxxxaxxxa, xaxxxaxxxxxaxxxa, ... (letters other than a replaced by x here for clarity).
 A: This is for 4 $a$'s and a string of length $n\ge 6$ and with the latest restriction: Each $a$ must have to its left or its right another $a$ with exactly three letters between (some of these may also be $a$ or not). For more $a$'s the count gets much more complicated.
Now the leftmost $a$ in say position $p$ is required to have another $a$ in position $p+4.$ So we'll call this the "left pair" $(w,x)=(p,p+4).$ Similarly the rightmost $a$ in position say $q$ is required to have another $a$ with exactly three letters between, this is the "right pair" $(y,z)=(q-4,q).$
These pairs chosen, the requirements are automatically satisfied for all 4 $a$'s. To count these we only need worry that we need $x \neq y.$ 
Now $w$ can be anything from position $p=1$ up to $p=n-5$ (To leave room for the right pair which has rightmost possible position $(n-4,n).$) Similarly the right pair can have its left end anywhere from position $p=2$ up to $p=n-4.$ So as far as the left endpoints of the left and right pairs, we are choosing them from the numbers between $1$ and $n-4$ which means, including unwanted collisions wherein $x=y$ that we have so far $\binom{n-4}{2}$ choices, from which something has to be subtracted.
The bad cases are of the form axxxaxxxa which is a string of length $9$ so there are $n-8$ of these, I think. Anyway we now subtract $n-8$ form the above binomial coefficient to get the total number of ways to place the $a$'s.
Now whatever else makes up the original string can be rearranged in some number $m$ of ways, obtained using a multinomial coeffient, and then this would be multiplied by the count of how many ways to place the $a$'s
Note: The least $n$ for which there is an allowable $a$ placement is $n=6,$ the string being aaxxaa. For $n=6,7$ the "subtracted" $n-8$ above should be viewed as $0$ to reflect that there are no bad strings axxxaxxxa (such a bad string must have length $9$ so won't occur when $n=6,7$ (nor when $n=8$ but in that case the above says to subtract $8-8=0$ anyway).
