Arno,
You should read Ben's suggestion more carefully. You need a while loop, because it only needs to iterate once for each "3" found, and not for each element in the array. You are doing duplicate work.
I have attached a corrected version (red box on image).
I also show an alternative version that is simpler and does the same thing (green box). This loop runs once per original array element and appends the result whenever a match is found. I don't think there is a performance penalty, even "search array" needs to look at all elements in one way or other.
😉As explained on the diagram, you should *really* consider to use the indexes native to LabVIEW (first element is position 0) and not your own (first element is 1). It will be much easier
to work with array indexes later. (Your result should be (0, 17, 19, 39)!)
Suggestion: (Red box): build array with the value before the "+1" and change the other case to "-1". (Green box): drop the "+1".