*************************
You are throwing out random numbers when you don’t “like” them.
Specifically, you generate new random
numbers whenever the numbers are too close together. Are you sure that’s
random? Granted, it probably won’t break the Mersenne Twister generator
used by Octave. But it is suspicious that you are discarding things
which look very much like the pattern for which you are searching.
Wouldn’t it be better to do a: for n=35:31 … rn =
fix(1+rand*n) … end and then map those numbers onto the integers in the
list? Paul
************************
It looked to me like a row of integers was scanned as each integer was
added to see if it duplicated any other integer in the row: if it did,
it was discarded in favor of another candidate.