Subgroup of $S_n$ generated by $(1,2,\cdots,n)$ and $(1,2,\cdots,m)$. I'm working on the following problem: 

Let $G$ be the subgroup of $S_n$ generated by $(1,2,\cdots,n)$ and
  $(1,2,\cdots,m)$ where $1<m<n$. Show $G$ is $S_n$ if either $m$ or $n$
  is even, and otherwise, $G$ is $A_n$.

I know that $G$ is primitive and there's a related theorem: 

Let $G$ be a primitive subgroup of $S_n$, if $G\neq S_n,A_n$, then
  $|S_n:G|\geq[(n+1)/2]!$.


I'll be using right actions (so for $x,y\in S_n$, $xy$ means apply $x$ then $y$) and the notation $x^y=y^{-1}xy$. 
I will assume the following (which can be proved by induction):

$A_n=\langle(1,2,3),(2,3,4),\ldots,(n-2,n-1,n)\rangle$

Let $\sigma=(1,\ldots,n)$, $\tau=(1,\ldots,m)$, so
$$\tau^\sigma=(2,3,\ldots,m+1)$$
$$\tau(\tau^\sigma)^{-1}=(1,m+1,m)$$
$$\left(\tau(\tau^\sigma)^{-1}\right)^{(\tau^\sigma)^2}=(1,3,2)$$
So $(1,3,2)\in G$ and therefore $(1,2,3)\in G$.
For $i=1,\ldots,n-3$ we have $(1,2,3)^{\sigma^i}=(i+1,i+2,i+3)$ giving $A_n\le G$. 
Clearly $G=A_n$ if and only if $\sigma,\tau\in A_n$ if and only if $n$ and $m$ are odd. 
