I am developing a program, that uses a lot of stuff related to the periodic table. As of now, I am making a part of it the determines the period and family. I know that both of those have to do with how many valence electrons each element has. So I want to know if there are formulas to find the amount of valence electrons, family, and periods?
The number of electrons in each orbital is double an odd number (the Pauli exclusion princilel states electrons can be in the same energy only if of opposite spin, so there can be two otherwise identical electron energy states [which can be separated in an EM field]).
- s (sharp spectral lines): 2 (twice 1)
- p (principal spectral lines): 6 (twice 3)
- d (diffuse spectral line): 10 (twice 5)
- f (fine, or "fundamental", spectral lines): 14 (twice 7)
Using that information, and the fact that the first row has only s electrons, second row s & p, usw., you should be able to calculate the first few rows easily. However, rules become much more complex for transition metals and heavier elements, where an outer shell may be added before all inner orbitals are filled.
Primary valence for the first few rows is simply the number of electrons needed to either complete the current shell (e.g. oxygen is two e- short), or revert to the previous complete, noble gas, configuration (e.g. Na minus one e- is neon). Again, there are complications, such as transition metals with multiple valences, fluorine reacting with some noble gases, usw.