Tell me more ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How do I ask Maple to skip an integer in a loop? Something like:

for i from 0 to n do

for j from 0 to n, j<>i, do ...

(I want j to skip i.)

share|improve this question

closed as off topic by Sasha, sdcvvc, John Wordsworth, Michael Greinecker, Jesse Madnick Aug 30 '12 at 4:57

Questions on Mathematics Stack Exchange are expected to relate to math within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

up vote 2 down vote accepted

Well you can always use an if statement:

for i from 0 by 1 to n do
 for j from 0 by 1 to n do
 if i <> j then {} end if 
 end do 
end do
share|improve this answer
Perhaps there is a simpler way? – TCL May 31 '12 at 22:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.