What rule or rules did Madelung discover, exactly?

There are two widely used rules of thumb to determine which subshells are filled in a neutral atom in its ground state:

• Electrons are assigned to subshells in order of increasing value of $$n + \ell$$.

• For subshells with the same value of $$n + \ell$$, electrons are assigned first to the subshell with lower $$n$$.

These rules don't always hold, but that's not my concern here. My question is: which of these rules did Erwin Madelung discover? (Both? Just one?)

Wikipedia seems to say Charles Janet discovered the first in 1928:

A periodic table in which each row corresponds to one value of $$n + \ell$$ (where the values of $$n$$ and $$\ell$$ correspond to the principal and azimuthal quantum numbers respectively) was suggested by Charles Janet in 1928, and in 1930 he made explicit the quantum basis of this pattern, based on knowledge of atomic ground states determined by the analysis of atomic spectra. This table came to be referred to as the left-step table. Janet "adjusted" some of the actual $$n + \ell$$ values of the elements, since they did not accord with his energy ordering rule, and he considered that the discrepancies involved must have arisen from measurement errors. In the event, the actual values were correct and the $$n + \ell$$ energy ordering rule turned out to be an approximation rather than a perfect fit, although for all elements that are exceptions the regularised configuration is a low-energy excited state, well within reach of chemical bond energies.

It then goes on to say:

In 1936, the German physicist Erwin Madelung proposed this as an empirical rule for the order of filling atomic subshells, and most English-language sources therefore refer to the Madelung rule. Madelung may have been aware of this pattern as early as 1926.

Is "this" still rule 1?

It then goes on to say:

In 1945 William Wiswesser proposed that the subshells are filled in order of increasing values of the function

$${\displaystyle W(n,l)=n+l-{\frac {l}{l+1}}.}$$

This is equivalent to the combination of rules 1 and 2. So, this article seems to suggest that rule 2 was discovered by Wiswesser. But I have my doubts. Goudsmit and Richards write:

Madelung discovered a simple empirical rule for neutral atoms. It consists of two parts.

and then they list both 1 and 2.

I have not yet managed to get ahold of Erwin Madelung's work, e.g.

• E. Madelung, Die mathematischen Hilfsmittel der Physikers, Springer: Berlin, 1936

The only relevant section in E. Madelung's edited book, Die mathematischen Hilfsmittel der Physikers, Springer: Berlin, 1936 is a small paragraph. It seems Madelung just called this for electron book-keeping and he had no justification for his proposition. He calls it a lexicographic order (lexikographische Ordnung).

I was searching for it some other reasons several months ago. Question in SE Physics. The original and the (machine but edited) translations is shared.

15 Atomic structure (electron catalog) (to p. 301).

The eigenfunction of an atom, consisting of $$Z$$ electrons and $$Z$$ -times positively charged nucleus, can be constructed in the case of removed degeneracy in first approximation as a product of $$Z$$ hydrogen eigenfunctions (cf. p. 356), each of which is defined by four quantum numbers $$n, l, m, s$$ defined by $$n>0, n-1 \geqq l \geqq 0, s=\pm \frac{1}{2}, m \leqq l$$. According to the Pauli's principle, no two of these functions may coincide in all four quantum numbers. According to the Bohr principle of structure, an atom with $$Z$$ electrons is formed from an atom with $$(Z-1)$$ electrons by adding another one (and increasing the nuclear charge by 1) without changing the quantum numbers of the already existing electrons. Therefore a catalog can be set up, from whose in each case $$Z$$ first positions the atom is built up in the basic state (cf. the table p. 360 ).

The ordering principle of this catalog is a lexicographic order according to the numbers $$(n+l), n, s, m .$$ A theoretical justification of just this arrangement is not yet available. One reads from it:

1 The periodic system of the elements. Two atoms are homologous, if in each case their "last electron" in the $$l, m, s$$ coincides.

2 The spectroscopic character of the basic term, entered in column 10 . There is namely $$|\Sigma m|=0,1,2,3 \ldots$$ the character$$S P, D, F, G, H, I \ldots$$ and $$(2|\Sigma s|+1)$$ the multiplicity.

3 The possibilities for excited states (possible terms), where not all $$Z$$ electrons are in the first $$Z$$ positions of the catalog.

The catalog is the representation form of an empirical rule. It idealizes the experience, because in some cases deviations are observed.