TITLE: Returning Paths on Cubic Graphs Without Backtracking
QUESTION [12 upvotes]: I was once interested in the  returning paths on cubic graphs . But I'm even more curious to have the number of ways without backtracking, which means doing one step forward and than one back (which might be good for dancing), e.g. $1\to 2\to 1$ .
The solution with the powers of the adjacency matrix doesn't seem to work here. Does anybody know a solution?

REPLY [5 votes]: Chris Godsil's beautiful answer is marred, I believe, by errors in the last two lines.  Since numerous other posts refer to that answer and since there seems to be some reluctance to modify it, while at the same time there still seems to be some confusion/disagreement about what the correct result is, I have written this community wiki answer in order to place what I believe to be a corrected version of Chris's answer on the record.  If this correction is in error, I hope that people will downvote it mercilessly; if it is valid, I hope that some form of the corrections will be incorporated into the original post so that this answer can be deleted.
Here is Chris's answer, with correction appended:

Call a walk reduced if it does not backtrack.
  If $A=A(X)$ for a graph $X$, define $p_r(A)$ to be the matrix (of the same order as $A$) such
  that $(p_r(A)_{u,v})$ is the number of reduced walks in $X$ from $u$ to $v$. 
  Observe that 
  $$
 p_0(A)=I,\quad p_1(A) =A,\quad p_2(A) = A^2-\Delta,
$$
  where $\Delta$ is the diagonal matrix of valencies of $X$.  If $r\ge3$ we have the recurrence
  $$
 Ap_r(A) = p_{r+1}(A) +(\Delta-I) p_{r-1}(A).
$$
  These calculations were first carried out by Norman Biggs, who observed the implication that $p_r(A)$ is a polynomial in $A$ and $\Delta$, of degree $r$ in $A$.
If $X$ is cubic, $\Delta=3I$ and we want the polynomials $p_r(t)$ satisfying the recurrence
  $$
  p_{r+1}(t) = tp_r(t)-2p_{r-1}(t)
$$

with initial conditions $p_1=t$ and $p_2=t^2-3$.  Note that the recurrence does not hold when $r=1$ since $tp_1(t)-2p_0(t)=t^2-2$ is not equal to $p_2(t)=t^2-3$.  The function $q_r(t)=2^{-r/2}p_r(2^{3/2}t)$ satisfies the recurrence of the Chebyshev polynomials,
$$
q_{r+1}(t)=2tq_r(t)-q_{r-1}(t)
$$
with initial conditions
$$\begin{aligned}
q_1(t)&=2t=U_1(t)=U_1(t)-\frac{1}{2}U_{-1}(t),\\
q_2(t)&=4t^2-\frac{3}{2}=4t^2-1-\frac{1}{2}=U_2(t)-\frac{1}{2}U_0(t).
\end{aligned}
$$
Here $U_r(t)$ are the Chebyshev polynomials of the second kind, which satisfy the initial conditions
$$
\begin{aligned}
U_0(t)&=1,\\
U_1(t)&=2t,
\end{aligned}
$$
and the further relations
$$
\begin{aligned}
U_{-1}(t)&=0,\\
U_2(t)&=4t^2-1,
\end{aligned}
$$
as implied by the recurrence.  Since the recurrence is linear, we conclude that
$$
q_r(t)=\begin{cases}1 & \text{if $r=0$,}\\ U_r(t)-\frac{1}{2}U_{r-2}(t) & \text{if $r\ge1$.}\end{cases}
$$
From this it follows that
$$
p_r(t)=\begin{cases}1 & \text{if $r=0$,}\\ 2^{r/2}U_r(t/2^{3/2})-2^{(r-2)/2}U_{r-2}(t/2^{3/2}) & \text{if $r\ge1$.}\end{cases}
$$