I am looking at a programming problem here, and would like to "deduce" a formula out of my problem.

I have an array of n (known) columns and two rows. I populate this array with number in a range (1 to n) let's say 1 to 5 for the example.

Code:

```
1 3 2 5 1 n
2 4 1 4 2 n
```

I do understand that each number, occurs 1/range but I don't know how to link everything together to actually make a formula out of it, so if any of you has suggestion or an explanation ... i'd be really happy to read it.

Thanks