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.
Errr... i, j, k are often used in mathematical proofs in summations and things like that... are we sure that's not why Fortran used them in the first place?
Which came first, the chicken or the egg? Math or Fortran?
I learned to program on the ZX Spectrum (Awesome home computer).
The spectrum had a great(ish) keyboard, where each key also had about 3 or 4 BASIC shortcuts on it, which you could get with various shift keys. Also it would recognize when it was expecting a statement, and just use the statement for that key instead of the letter.
For example, to type "for f", you would press the 'f' key twice, as it had the shortcut 'For' on it, and also was the letter f.
Similarly, to type "next n", you'd hit the 'n' key twice.
Perhaps why you sometimes see f and n in for loops.
Wow! I did a global search for the variables "i", "j", and "k" in this 2000 line program I have to enhance, and I got all of them and a whole lot more! What a great idea!
I always thought it was because programmers were too lazy to write a couple of extra characters to make a nice descriptive variable name. At least that's why I do.
> I always thought it was because programmers were too lazy to write a couple of extra characters to make a nice descriptive variable name.
Nah. A variable name's descriptiveness (and length) should be proportional to the size of the scope in which it's used. A simple loop index should almost never be longer than i, j, k, etc.
Could it have something to do with the keyboard layout?
On standard keyboards "i" is just above "j & k". Also in basic typewriter tuition, your right hand apposing finger starts on the keyboard at the letter "j" when you commence typing. "k" has your right index finger. Most people being right handed these letters are pretty much the first & most intuitive letters to use.