CJam, (削除) 87 (削除ここまで) (削除) 83 (削除ここまで) (削除) 82 (削除ここまで) 80 bytes
0"hTH^Løìð^R1⁄4Ä^X¿håêÛ3⁄4aÔ^G^Æ^Y^Æ1⁄4^Q"256b6b5a/4a8**li<{[33:B_B*65_B*1]=\_B%8=B\#*+}/Bb0-`
The above code uses caret notation for the control characters in the string. It is equivalent to the following code, which an array of character code instead:
0[104 84 72C248 236 240I188 196 24 191 104 229 234 219 190 170 212 7 134 25 134 188H]
256b6b5a/4a8**li<{[33:B_B*65_B*1]=\_B%8=B\#*+}/Bb0-`
You can try the second version in the CJam interpreter.
How it works
The basic idea is to consider the electron configurations base 33 numbers. This reduces operations needed to pass determine the atom A[n] to the following:
A[n] = A[n-1] * 33(add a new shell)A[n] = A[n-1] + 1(add an electron to the outer shell)A[n] = A[n-1] + 33(add an electron to the second outer shell)A[n] = A[n-1] + 65(add two electrons to the second outer shell; remove one from the first)A[n] = A[n-1] + 1089(add an electron to the third outer shell)A[n] = A[n-1] + 2145(add two electrons to the third outer shell; remove one from the second)
Example run
$ base64 -d > electrons.cjam <<< MCJoVEgM+OzwErzEGL9o5erbvqrUB4YZhrwRIjI1NmI2YjVhLzRhOCoqbGk8e1szMzpCX0IqNjVfQioxXT1cX0IlOD1CXCMqK30vQmIwLWA=
$ cksum electrons.cjam
3709391992 80 electrons.cjam
$ for i in {1..118}; do LANG=en_US cjam electrons.cjam <<< $i; echo; done
[1]
[2]
[2 1]
[2 2]
[2 3]
[2 4]
[2 5]
[2 6]
[2 7]
[2 8]
[2 8 1]
[2 8 2]
[2 8 3]
[2 8 4]
[2 8 5]
[2 8 6]
[2 8 7]
[2 8 8]
[2 8 8 1]
[2 8 8 2]
[2 8 9 2]
[2 8 10 2]
[2 8 11 2]
[2 8 13 1]
[2 8 13 2]
[2 8 14 2]
[2 8 15 2]
[2 8 16 2]
[2 8 18 1]
[2 8 18 2]
[2 8 18 3]
[2 8 18 4]
[2 8 18 5]
[2 8 18 6]
[2 8 18 7]
[2 8 18 8]
[2 8 18 8 1]
[2 8 18 8 2]
[2 8 18 9 2]
[2 8 18 10 2]
[2 8 18 12 1]
[2 8 18 13 1]
[2 8 18 13 2]
[2 8 18 15 1]
[2 8 18 16 1]
[2 8 18 18]
[2 8 18 18 1]
[2 8 18 18 2]
[2 8 18 18 3]
[2 8 18 18 4]
[2 8 18 18 5]
[2 8 18 18 6]
[2 8 18 18 7]
[2 8 18 18 8]
[2 8 18 18 8 1]
[2 8 18 18 8 2]
[2 8 18 18 9 2]
[2 8 18 19 9 2]
[2 8 18 21 8 2]
[2 8 18 22 8 2]
[2 8 18 23 8 2]
[2 8 18 24 8 2]
[2 8 18 25 8 2]
[2 8 18 25 9 2]
[2 8 18 27 8 2]
[2 8 18 28 8 2]
[2 8 18 29 8 2]
[2 8 18 30 8 2]
[2 8 18 31 8 2]
[2 8 18 32 8 2]
[2 8 18 32 9 2]
[2 8 18 32 10 2]
[2 8 18 32 11 2]
[2 8 18 32 12 2]
[2 8 18 32 13 2]
[2 8 18 32 14 2]
[2 8 18 32 15 2]
[2 8 18 32 17 1]
[2 8 18 32 18 1]
[2 8 18 32 18 2]
[2 8 18 32 18 3]
[2 8 18 32 18 4]
[2 8 18 32 18 5]
[2 8 18 32 18 6]
[2 8 18 32 18 7]
[2 8 18 32 18 8]
[2 8 18 32 18 8 1]
[2 8 18 32 18 8 2]
[2 8 18 32 18 9 2]
[2 8 18 32 18 10 2]
[2 8 18 32 20 9 2]
[2 8 18 32 21 9 2]
[2 8 18 32 22 9 2]
[2 8 18 32 24 8 2]
[2 8 18 32 25 8 2]
[2 8 18 32 25 9 2]
[2 8 18 32 27 8 2]
[2 8 18 32 28 8 2]
[2 8 18 32 29 8 2]
[2 8 18 32 30 8 2]
[2 8 18 32 31 8 2]
[2 8 18 32 32 8 2]
[2 8 18 32 32 10 1]
[2 8 18 32 32 10 2]
[2 8 18 32 32 11 2]
[2 8 18 32 32 12 2]
[2 8 18 32 32 13 2]
[2 8 18 32 32 14 2]
[2 8 18 32 32 15 2]
[2 8 18 32 32 16 2]
[2 8 18 32 32 18 1]
[2 8 18 32 32 18 2]
[2 8 18 32 32 18 3]
[2 8 18 32 32 18 4]
[2 8 18 32 32 18 5]
[2 8 18 32 32 18 6]
[2 8 18 32 32 18 7]
[2 8 18 32 32 18 8]
Dennis
- 211.7k
- 41
- 380
- 830