Quality and degree of a musical interval as linear combinations: Is this a known construction? At some point I discovered that the 'degree' of an interval (unison, sixth, ...) is simply determined by writing it as $\;t\text{ major seconds} + s\text{ sharps}\;$ (both $\;t\;$ and $\;s\;$ can be negative, for example$\;-2\text{ sharps} = 2\text{ flats}\;$; and this 'factorization' is unique), and then $\;t\;$ completely determines the degree:

*

*$\;t+1\;$ being $1$ is a unison, $2$ is a second, ..., $5$ is a fifth, ..., $8$ is an octave, etc.

*$\;t-1\;$ being $-1$ is an inverted unison, $-2$ is an inverted second, ..., $-5$ is an inverted fifth, ..., $-8$ is an inverted octave, etc.

(Note how I also could have chosen minor seconds instead of major seconds.  Note also that this doesn't say that e.g. $\;t=7\;$ major seconds make up an octave; it just says that $7$ major seconds differs from an octave by at most a number of sharps.)
Relatedly, I discovered that if you want to know the 'quality' of a musical interval (whether it is e.g. augmented or perfect or minor), then the simplest way is to write the interval (again uniquely, again positive and negative integers allowed) as $\;f\text{ fifths} + o\text{ octaves}\;$, and then $\;f\;$ completely determines the quality:

*

*$\;f\;$ from $-1$ to $5$ is major (but see below!), from $6$ to $12$ is augmented, from $13$ to $19$ is doubly augmented, etc.

*$\;f\;$ from $1$ to $-5$ is minor (but see below!), from $-6$ to $-12$ is diminished, from $-13$ to $-19$ is doubly diminished, etc.

*Except if $\;f\;$ is between $-1$ and $1$ then we don't call it major and minor, but instead perfect.

Note how this gives 'blocks' of 7 that all have the same quality, so all are major, or all doubly diminished.
More mathematically, $\;h(f) = \max(0, \left\lfloor (f+8)/7 \right\rfloor)\;$ determines how 'major' an interval with $\;f\;$ fifths is (and $\;h(-f)\;$ how 'minor' it is); so that $\;h(f)-h(-f)\;$ is $0$ for a perfect interval, $2$ for an augmented one, $-1$ for a minor one, etc.
So for example, the interval of $\;10\text{ fifths} - 6 \text{ octaves} \;=\; -2\text{ major seconds} + 2\text{ sharps}\;$ (e.g. from E♭ to the C♯ below it) is the inverted third ($\;t-1=-3\;$) that is augmented ($\;f=10\;$).  Which we don't normally call the augmented inverted third, but instead the inverted diminished third (where the move of "inverted" flips between major and minor).

Note how each 'factoring' is really writing an interval as a linear combination of basis vectors, either of $\;(1\text{ fifth}, 1\text{ octave})\;$ or of $\;(1\text{ major second}, 1\text{ sharp})\;$.
Also, note that this is simple in computational or mathematical terms, not necessarily for human day-to-day use.

My question: Is this explained any in music theory resource, preferably online, where I perhaps could also find some more background and musical and mathematical connections?
Because I can't imagine I would be the first to discover this. 
 A: (Answer edited after discussion in comments)
The first point, about the degree of an interval (unison, second, third etc.) comes from the fact that each major second moves one place on the scale (i.e. one place up on the staff). So adding major seconds gives a bijection between the number of added major seconds, and the place on staff, nothwithstanding flats or sharps. The interval degree is named after the number of places on the staff between the two notes, hence the correspondance with added major seconds.
It is not easy to search for such references in music books. However I feel it is not much probable that such an explanation of degrees would be found in a music book. The reason is: for tonal music, adding major seconds makes sense only up to $2$ or $3$ major seconds, not above. Even "$3$ major seconds, minus one sharp" (let's say for C-F) is very rarely useful:

*

*in G major, in a transition to C major (hence the natural F instead of F sharp: this gives our "minus one sharp");

*in G flat major, in a transition to D flat major (hence the natural C instead of C flat; this gives the "minus one sharp").

In all other uses, the interval C-F is heard as two major seconds and one minor second, in any order:

*

*two major seconds then one minor second, in C major or F major;

*one minor second then two major seconds, in D flat major or A flat major;

*one major second then one minor second then one major second, in B flat major or E flat major.

In a whole-tone scale, describing intervals as additions of major seconds makes much more sense $-$ but music books (at least the ones which care to define interval names, which are for beginners) are written with tonal music in mind.

For rhe second point, about quality of an interval, I found a reference for the naming related to the fifths. This is from Laurent Fichet's book (in French) "Les théories scientifiques de la musique", $1995$, p. $73$.
This book explains $19$th and $20$th centuries scientific theories about music, both tonal and atonal, concentrating on intervals, consonance, etc. The table below is extracted from the description of Charles Henry's theories.
Although the text does not mention that from $+2$ to $+5$ it is major, etc., this is obvious from reading the table, apart in two places where an alternate name is used (chromatic semitone and diatonic semitone, instead of augmented unison and diminished second).
This table comes from Charles Henry's book "Cercle chromatique" p. $115$ and can be seen here:
https://gallica.bnf.fr/ark:/12148/bpt6k109169f/f114.item
The strangest thing is that Charles Henry's book deals more with general and visual aesthetics than auditive ones. I am pretty sure the same table can be found in more usual music books.

