Artificial intelligent assistant

Decompose permutation $σ=(123)(345)(4567).$ i'm getting confused at how to decompose this permutation I've seen this post about how to decompose How to decompose permutations? I understood and managed to apply to other kind of permutation but I'm struggling with this one σ=(123)(345)(4567) σ(1) = 2 because 1->2 in (123) That's where i'm confused : σ(2) = 5 2 -> 3 , 3 -> 4 ( in 345), 4-> 5 (in 4567) Do I stop here ? Or continue 5-> 3 ( in 345), 3->4 (in 345), 4->5 ( in 4567) but it's getting weird, i'm entering a loop when do I actually stop ?

You're right: $\sigma(2)=5$ (when read left-to-right).

You don't just stop there, although that's it for how $\sigma$ behaves on $2$. The next number to consider is indeed $5$.

Once you hit a number you've considered before, move on to the next number you have not (if there be such).

You should get $$\sigma=(1253)(467).$$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 3f7ba6916b9511d8e785592efc87f9fd