Pretty basic stuff for people with music knowledge. I did not, so I found thinking in this way very helpful.
The automorphism given by multiplication by 7 on Z/12Z is this:
[0 1 2 3 4 5 6 7 8 9 10 11] ↦ [0 7 14 21 28 35 42 49 56 63 70 77] mod 12 = [0 7 2 9 4 11 6 1 8 3 10 5]
Setting C = 0, we have [C G D A E B F#=Gb C#=Db G#=Ab D#=Eb A#=Bb F]. Indeed, raising 7 semitones = raising perfect fifth in 12TET. Notice C-major occurs in this image as a (cyclically) consecutive sequence (i.e. imagine that the square brackets cyclically loops around to the other side -- ...A# F - C G..., and so on).
C major in this regular encoding is [0 2 4 5 7 9 11] from WWHWWWH. We can obtain the major scales rooted at different tonics by shifting relative to C. G is a perfect fifth up from C. And this means adding 7 to every note, obtaining [7 9 11 12 14 16 18] = [7 9 11 0 2 4 6] mod 12.
In the order of the observed image of the automorphism above:
The entire 7-consecutive sequence of C-major is cyclically shifted to the right by one. This makes sense, because G major is obtained from C major by a +perfect fifth transposition: F+perfect fifth = C, C+perfect fifth = G, and all the way to B+perfect fifth = F#.
Therefore, since every diatonic scale is the result of a transposition of C major (they all have the WWHWWWH offset pattern but with a different starting tonic), every diatonic scale appears as a 7-consecutive cyclic subsequence of [0 7 2 9 4 11 6 1 8 3 10 5] = [C G D A E B F# C# G# D# A# F].
Notice that in the middle we the natural notes G D A wrapped around by F C to the left and E B to the right contain natural-natural pairs of enharmonic equivalents. In particular F=E#, C=B#, E=Fb, B=Cb. So we actually have:
(*): [Fb=E Cb=B Gb Db Ab Eb Bb F / C G D A E B F# C# G# D# A# / E#=F B#=C]
Notice that since the sequence as 12 repeating elements, there are only 12 distinct 12-consecutive sequences. By anchoring ourselves at C major with 0 offset. We can have the twelve different configurations:
[F#/Gb major (-6), C#/Db major (-5), G#/Ab major (-4), D#/Eb major (-3), A#/Bb major (-2), F Major (-1), C major (0), G major (+1), D major (+2), A major (+3), E major (+4), B major (+5), F#/Gb major (+6)]
where we notice that have -6 is the same as +6.
Not that we can locate any of the above 12 of the 7-sequences entirely within in (*). And since (*) is both with 3 repetitions of the labels FCGDAEB up to accidentals, every one of the sequences can be written with the letters A-G appearing only once. In other words, the 12-cyclic sequence can be (informally) transformed into a 7-cyclic labeling system (by using accidentals).
We also observe that everything to the right of C major in (*) is sharped, and everything to the left is flatted (including the two natural-natural enharnomic equivalent pairs in B<->C;E<->F). So this 7-cyclic traditional/diatonic labeling system has the an additional nice property that the number of accidentals (sharps or flats) is the same as the shift amount relative to C major, with the order of accidentals appearing always in FCGDAEB (from left for sharp; from right for flat).
P.S. The only generators of Z/12Z are +1, -1=+11, +7, -7=+5. So either 1 semitone up or down, or one perfect fifth up or down (perfect fourth mod 12). So really since the circle of fourths is the same phenomenon in reverse, 7 (perfect fifth) is really the only special number where we can observe this special structure (+-1 semitone is not as interesting since it is just the chromatic system).