R, (削除) 301 (削除ここまで) (削除) 289 (削除ここまで) (削除) 287 (削除ここまで) 280 bytes
Explanation.
Look up the index of the mass sorted atomic number in a UTF8 encoded hash string s. The hash is taken by taking the element name as a base 36 case insensitive number and modding with 908, then 591, then 321. The operator + is used for the UTF8 to integer vector conversion.
Encode the masses of the elements as a UTF8 encoded string of differences, packing 2 differences into each byte as 9*d1 + d2 where d1 is the difference of the nth element and d2 is the successive mass difference of the n+50th element. Then to retrieve the mass, take the corresponding position at the cumulative sum of the differences. This is shorter than a quadratic formula.
function(x)sum(c(o%%9,o%/%9)[1:match(strtoi(x,36)%%908%%591%%321,+'#·Yû÷Ù<vBypàéÿ6ĉčCrfK":øá^Q7|P{oĦU ̄}úzÕČμ-ÒÃ$ NĭTE%]DWöJ3Ć=
_~Óñ')])
"+"=utf8ToInt
o=+"0%..%$%%
p
&00(1"
- 2.7k
- 12
- 15