SEPA algorithm calculates the next permutation of a sequence in O(n).
If you find any bugs, please contact me to joao | DOT | carreira | AT | ist | DOT | utl | DOT | pt