If I take a set of elements that can be put in an order, for example the numbers 1,2,3,4 what is it called when I visit the elements from the beginning to the end, and invert direction whenever hitting either the end or the beginning? After going from 3 to 4, the next number would be 3 again. This is distinct from a loop where direction is not inverted and the next number after 4 would be 1. At least that's how I see it. The context is programming.
I have seen numbers like 1234321, the numbers of the sequence described concatenated together, called palindromic. If the sequence ends and if that end is the first element, the Wikipedia entry suggests you can use the word palindrome to refer to it:
A palindrome is a word, phrase, number, or other sequence of symbols or elements, whose meaning may be interpreted the same way in either forward or reverse direction.
Note that this is not always the same as saying sequence of the palindrome 1234321; such a loop would have two 1's together.
In a programming context, this jit.qt.movie documentation (for editing/playing video) has a loop attribute with a palindrome mode, described as:
palindrome looping (start to end to start to ....)
Personally, if I didn't know beforehand where the loop would end, I would use J.R.'s suggestion of serpentine instead.