First of all I thank you for your interest. I knew nothing about Sage till today's evening. I tried to type your code directly into the console, but something happens at line 8. Is any way I can include this function in the core of the program so that I don't need to define it everytime from console (just in case I am able to do so...). I mainly understand your code even I know nothing about this language nor its functions. Any comment that lead to understanding would be really appreciated.
Angel (May 27 '12)You can put this in ~/.sage/init.sage and it will be loaded each time you start Sage. You can also run "%cpaste" from the command line, paste the code in, and then put in "--" to finish the paste.
Mike Hansen (May 27 '12)Cool! I actually managed myself to write a slightly different version of your code. Great. I really thank you for your help ^^'.
Angel (May 28 '12)