Index k doesn't cover the entire range from 1 to n*(n + 1)/2 needed to store all elements of symmetric matrix.
Also, k is 0 when both i and j are equal to 1, while Fortran arrays are 1 based.
You're right, there's an error in formula. It should be i-1+j*(j-1)/2 instead. However, it is correct that k(1,1)=0 as the link you were referred to is C documentation. In C documentation, we provide indices in C array notation. If you need an index in Fortran array, your formula would be i+j*(j-1)/2
Thank you very much for finding this! We will fix it ASAP.