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]!$.


It is enough to show that $G$ contains enough $3$-cycles to generate $A_n$. 
Note that $(m+1,2,\ldots,m)=(1,\ldots,n)(1,\ldots,m)(1,\ldots,n)^{-1} \in G$. 
So $(1,2,m+1) = (1,2,\ldots,m)(m+1,2,\ldots,m)^{-1} \in G$. 
So $(1,2,3) = (m+1,2,\ldots,m)(1,2,m+1)^{-1}(m+1,2,\ldots,m)^{-1} \in G$. 
By conjugating $G$ contains every $(k,k+1,k+2)$. 
Thus $G$ contains permutations $\sigma$ such that $\sigma(1)=1$, $\sigma(2)=2$ and $\sigma(3)$ is arbitrary. 
By considering the $\sigma (1,2,3) \sigma^{-1}$, $\sigma \in G$, it follows that $G$ contains all of the $(1,2,j)$, $j \geq 3$. 
For $i \neq j$, $i,j > 2$, $(1,j,i)=(1,2,i)(1,2,j)^{-1} \in G$. So $G$ contains all of the $(1,i,j)$. 
So for distinct $i,j,k$, $(i,j,k)=(1,i,j)(1,j,k) \in G$. As a conclusion, $G \supset A_n$. 
