[…] A homework ? […]
It is sad if the OP doesn't come back.
Plese do not remove the original post.Now it is totally unclear what this topic was about.
123412431324134214231432213421432314234124132431312431423214324134123421412341324213423143124321
As long as OP can generate this sequence he is on the right track. Code: [Select]1234...4321 Now, shall I publish some code?
1234...4321
writeln('1234');writeln('1243');writeln('1324');...