A theoretical study on the mechanisms of the reactions between 1,3-dialkynes and ammonia derivatives for the formation of five-membered N-heterocycles.