How can we count different coloring in 2 cycle with one edge in common There is a question that asked what is the counts of different coloring in $C_5$ and $C_6$ when it has one edge in common:

I have used fundamental reduction in cycles in order to get a recursive formula (I know there is a closed formula for that too), but when i try use the same in this particular question, it becomes very complicated. How can I find a formula for this kind of graph? Im looking for Chromatic Polynomial. 

Let's first find a formula for a "mouse graph" ($C_n$ with a path $P_m$ attached)

This is easy with induction and the fundamental d-c. We know that for $n$-cycle the chromatic polynomial is $C_n(x) = (x-1)^n+(-1)^n(x-1)$ and we get that for the mouse it is
$$M_{n,m}(x) = (x-1)^m C_n(x)$$
Now for the graph in question. Let's denote the chromatic polynomial by $P_{n,m}$, where $n$ is the number of nodes in the first cycle and $m$ is the extra nodes in the second. So what we want is $P_{6, 3}$.
When we use deletion-contraction on the first edge that comes out on the second cycle, we get the recursion (and the basecase $P_{n,0} (x) = C_n(x)$)
$$P_{n,m}(x) = M_{n,m}(x) - P_{n,m-1}(x)\\
= M_{n,m}(x) - M_{n,m-1}(x) + P_{n,m-2}(x)\\
= \dots =\\
= \sum_{j=0}^m (-1)^j M_{n,m-j}(x) = C_{n}(x)\sum_{j=0}^m (-1)^j (x-1)^{m-j}\\
=  C_{n}(x)(-1)^m\sum_{j=0}^m  (1-x)^{j} \\
= C_n(x)(-1)^m\frac{1-(1-x)^{m+1}}{x}\\
= C_n(x)\frac{(x-1)^{m+1} + (-1)^m}{x}$$
You can check the answer with the following SAGE-code:
R.<x> = QQ['x']

def c(n):
    return x if n==1 else (x-1)**n + (-1)**n*(x-1)

def makeGraph(n, m):
    N = n+m
    g = Graph(N)
    for i in range(N): g.add_edge(i, (i+1)%N)
    if n>1 and m>1: g.add_edge(0, n-1)
    return g

def getFormula(n, m):
    #TODO doesn't work for n==1 or m==1
    p = c(n)*(-1)**m*(1-(1-x)**(m+1))/x
    return p


for n in range(1, 10):
    for m in range(1, 10):
        p = makeGraph(n,m).chromatic_polynomial()
        pFormula = getFormula(n,m)
        if p != pFormula:
            print("Wrong formula with %d, %d" %(n,m))
            print (p)
            print (pFormula)

EDIT The formula doesn't work for the cases where $n=1$ or $m=1$.
