That was exactly what I was thinking. n is used for naturals, i, j and k are used for variable values in sums, for example (which, when programmed, would require the use of "for" loops).
Like so many other things in mathematics, I suspect it goes back to Euler (18th century). He invented the capital-sigma notation for sums, although I'm not sure what letters he used for his indices.
The use of x, y and z as unknown reals goes far as back as Descartes. I don't know what he used for integers though, or whether he bothered to distinguish integers from reals.