Either with or without the article is OK in the second sentence, since 'mass' can be uncountable. You are right that 'index', a countable noun, demands the article in your first sentence.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.