HINT
To meet the non-adjacency clause, there can be at most $4$ tasks of type $B,\;viz\; BABABAB$
[Available spots for $B = (\#\; of\; A \;tasks\;+1)$, slots numbered after placing $Bs$ ]
Suppose there are two of $B$, thus five of $A$, since each task is distinct, choose the tasks in $\binom{10}{2}\binom{10}5$ ways, and place the $Bs$ in $\binom62 = 15$ ways in the slots. Finally, permute in $2!5!$ ways.
Work out similarly for number of $B$ tasks from $0\;through\;4$ and add up.
If the same task can be repeated any number of times, it is equivalent to finding the number of distinct words that can be formed with an alphabet of $ABCDEFGHIJabcdefghij$ in $n$ slots, with $k$ non-adjacent small letters, $ k \le (n-k+1)$
Ignoring the non-adjacency clause,
# of distinct words = coefficient of $x^n$ in $(n!)(1+ x + \frac{x^2}{2!} + \frac{x^3}{3!} + .... \frac{x^{n-k}}{(n-k)!})^{10}(1+ x + \frac{x^2}{2!} + \frac{x^3}{3!} + .... \frac{x^k}{k!})^{10}$
For an explanation of the formula, see here
P(small letters are non-adjacent)$ = \frac{\binom{n-k+1}{k}}{\binom {n}{k}}$
Multiply the two expresssions, and sum up for $k = 0 \; through\; (n-k+1)$