I am stuck with a very difficult problem of accessing data from a 1D array in a particular sequence as shown below.

Putting this in a 2D array with two loops this problem was less complicated because there is some triangular pattern. In 1D array(2D is not working in openCL), the problem got very complicated. It would be great is someone suggest some way to resolve this issue.
Edit
In 1D, they used to like below:

Number written by hand are indexes.