Hello Math Gurus

i Have been trying to solve this for 4 days now..Its time I accept ..I need help

Here is the problem

Lets say i have an aaray in C say a[256][256][124]

hence a[0][0][0]=0

a[1][0][0]=1

and so on and so forth

therfore i can get a generalised formula for calculating the linear index number as ;-

[(z*65536)+(y*256)+x]=index number

now lets say i have an index number 18921 how do i get the original x,y and z co-ordinates

Help needed