Let AA and EE be opposite vertices of a regular octagon. A frog starts jumping at vertex AA. From any vertex of the octagon except E,E, it may jump to either of the two adjacent vertices. When it reaches vertex E,E, the frog stops and stays there. Let ana_n be the number of distinct paths of exactly nn jumps ending at E.E. Prove that a2n1=0,a_{2n-1}=0,

a2n=12(xn1yn1),n=1,2,3,,a_{2n}=\frac{1}{\sqrt{2}}(x^{n-1}-y^{n-1}),\quad n=1,2,3,\cdots,

where x=2+2x=2+\sqrt{2} and y=22.y=2-\sqrt{2}.

Note. A path of nn jumps is a sequence of vertices (P0,,Pn)(P_0,\ldots,P_n) such that

(i) P0=A,Pn=E;P_0=A, P_n=E;

(ii) for every i,0in1,Pii, 0\leq i\leq n-1, P_i is distinct from E;E;

(iii) for every i,0in1,Pii, 0\leq i\leq n-1, P_i and Pi+1P_{i+1} are adjacent.