Question: Findind permue and combinat without using the inbuilt function

Kind help with a maple code without using the permute function maple such that I that can get each permutation at a time and as I do not want to store all the permutations in a list as it would require too much memory space when n is larger. So I would like to

say I have to permute [1,2,3] first I get 1,2,3 leave it , next get 2,1,3 leave it, 3,2,1 leave it and so I don't store them after using it.

the same way for combinations too without using the combinat to store entire in a list i want say choose from 1,2,3,4 say 3 elements at a time I choose 1,2,3 leave it next I choose say 1,2,4 leave it without storing after I have just used it

kind help please

Please Wait...