A Study of Scales
Where we discuss every possible combination of notes
Assumptions
This exploration of scales is based in a musical universe founded on two assumptions:

Octave Equivalence
We assume that for the purpose of defining a scale, a pitch is functionally equivalent to another pitch separated by an octave. So it follows that if you're playing a scale in one octave, if you continue the pattern into the next octave you will play pitches with the same name. 
12 tone equal temperament
We're using the 12 tones of an equallytempered tuning system, as you'd find on a piano. Equal temperament asserts that the perceptual (or functional) relationship between two pitches is the same as the relationship between two other pitches with the same chromatic interval distance. Other tuning systems have the notion of scales, but they're not being considered in this study.
Representing a scale
When I began piano lessons as a child, I learned that a scale was made up of whole and halfsteps. The scale was essentially a stack of intervals piled up, that happened to add up to an octave. While this view of the scale is useful for understanding diatonic melodies, it's not a convenient paradigm for analysis. Instead, we should regard a scale as being a set of 12 possibilities, and each one is either on or off.
The major scale, in lights.
What we have in the 12tone system is a binary "word" made of 12 bits. We can assign one bit to each degree of the chromatic scale, and use the power of binary arithmetic and logic to do some pretty awesome analysis with them. When represented as bits it reads from right to left  the lowest bit is the root, and each bit going from right to left ascends by one semitone.
The total number of possible combinations of on and off bits is called the "power set". The number of sets in a power set of size n is (2^n). Using a word of 12 bits, the power set (2^12) is equal to 4096. The fun thing about binary power sets is that we can produce every possible combination, by merely invoking the integers from 0 (no tones) to 4095 (all 12 tones).
This means that every possible combination of tones in the 12tone set can be represented by a number between 0 and 4095. We don't need to remember the fancy names like "phrygian", we can just call it scale number 1451. Convenient!
decimal  binary  

0  000000000000  no notes in the scale 
1  000000000001  just the root tone 
1365  010101010101  whole tone scale 
2741  101010110101  major scale 
4095  111111111111  chromatic scale 
An important concept here is that any set of tones can be represented by a number. This number is not "ordinal"  it's not merely describing the position of the set in an indexed scheme; it's also not "cardinal" because it's not describing an amount of something. This is a nominal number because the number *is* the scale. You can do binary arithmetic with it, and you are adding and subtracting scales with no need to convert the scale into some other representation.
Scale Finder
Not sure what scale you've got? Check the boxes below tones that appear in your scale. Then follow the link to learn more about it!
Because scales are cyclical  they repeat and continue beyond a single octave  it is intuitive to represent them in "bracelet" notation. This visual representation is useful because it helps conceptualize modes and rotation (which we'll get into further below).
Here is the major scale, represented as a bracelet. Black beads are on bits, white beads are off bits.
If you imagine the bracelet with clock numbers, the topmost bead  at 12 o'clock  is the root, or 1st degree of the scale. Beware that in some of the math, this is the "0" position, as if we're counting semitones above the root. To play a scale ascending, start from the top and move around it clockwise. To play the scale descending, start at 12 o'clock and go around counterclockwise.
Interval Pattern
Another popular way of representing a scale is by its interval pattern. When I was learning the major scale, I was taught to say aloud: "tone, tone, semitone, tone, tone, tone, semitone". Many music theorists like to represent a scale this way because it's accurate and easy to understand: "TTSTTTS". Having a scale's interval pattern has merit as an intermediary step can make some kinds of analysis simpler. Expressed numerically  which is more convenient for computation  the major scale is [2,2,1,2,2,2,1].
Pitch Class Sets
Yet another way to represent a scale is as a "pitch class set", where the tones are assigned numbers 0 to 11 (sometimes using "T" and "E" for 10 and 11), and the set enumerates the ones present in the scale. A pitch class set for the major scale is notated like this: {0,2,4,5,7,9,11}. The "scales" we'll study here are a subset of Pitch Classes (ie those that have a root, and obey Zeitler's Rules^{1}) and we can use many of the same mathematical tricks to manipulate them.
What is a scale?
Or more importantly, what is *not* a scale?
Now that we have the superset of all possible sets of tones, we can whittle it down to exclude ones that we don't consider to be a legitimate "scale". We can do this with just two rules.

A scale starts on the root tone.
This means any set of notes that doesn't have that first bit turned on is not eligible to be called a scale. This cuts our power set in exactly half, leaving 2048 sets.
In binary, it's easy to see that the first bit is on or off. In decimal, you can easily tell this by whether the number is odd or even. All even numbers have the first bit off; therefore all scales are represented by an odd number.
We could have cut some corners in our discussion of scales by omitting the root tone (always assumed to be on) to work with 11 bits instead of 12, but there are compelling reasons for keeping the 12bit number for our scales, such as simplifying the analysis of symmetry, simplifying the calculation of modes, and performing analysis of sonorities that do not include the root, where an even number is appropriate.
function hasRootTone($scale) { // returns true if the first bit is not a zero return (1 & $scale) != 0; } $allscales = array_filter($allscales, 'hasRootTone');
scales remaining: 2048

A scale does not have any leaps greater than n semitones.
For the purposes of this exercise we are saying n = 4, a.k.a. a major third. Any collection of tones that has an interval greater than a major third is not considered a "scale". This configuration is consistent with Zeitler's constant used to generate his comprehensive list of scales.
function doesNotHaveFourConsecutiveOffBits($scale) { $c = 0; for ($i=0; $i<12; $i++) { if (!($scale & (1 << ($i)))) { $c++; if ($c >= 4) { return false; } } else { $c = 0; } } return true; } $allscales = array_filter($allscales, 'doesNotHaveFourConsecutiveOffBits');
scales remaining: 1490
Now that we've whittled our set of tones to only the ones we'd call a "scale", let's count how many there are with each number of tones.
function countOnBits($scale) {
$c = 0;
for ($i=0; $i<12; $i++) {
if ($scale & (1 << ($i))) {
$c++;
}
}
return $c;
}
number of tones  how many scales 

1  0 
2  0 
3  1 
4  31 
5  155 
6  336 
7  413 
8  322 
9  165 
10  55 
11  11 
12  1 
Heptatonics
The equal temperament system of 12 tones has a special affinity for heptatonic scales. Of the 1490 scales, 413 of them are heptatonic, comprising 28% of the total. The predominant scales used in popular music are heptatonic, including those derived most closely from the circle of fifths.
Some heptatonics are diatonic. To be diatonic means that it includes only notes in the prevailing key; so the set of diatonic scales are very limited to just the major scale and its 6 modes  and only when used in a context where the modes are offset in respect to the tonic key.
Hepatonia prima, secunda, tertia
(coming soon)
Symmetry
There are two kinds of symmetry of interest to scale analysis. They are rotational symmetry and reflective symmetry.
Rotational Symmetry
Rotational symmetry is the symmetry that occurs by transposing a scale up or down by an interval, and observing whether the transposition and the original have an identical pattern of steps.
The set of 12 tones has 5 axes of symmetry. The twelve can be divided by 1, 2, 3, 4, and 6.
Any scale containing this kind of symmetry can reproduce its own tones by transposition, and is also called a "mode of limited transposition" (Messaien)
Below are all the scales that have rotational symmetry.
axes of symmetry  interval of repetition  scales 

1,2,3,4,5,6,7,8,9,10,11  semitone  
2,4,6,8,10  whole tone  
3,6,9  minor thirds  
4,8  major thirds  
6  tritones 
number of notes in scale  Placement of rotational symmetries  

1  2  3  4  5  6  7  8  9  10  11  
3  0  0  0  1  0  0  0  1  0  0  0  
4  0  0  1  0  0  3  0  0  1  0  0  
5  0  0  0  0  0  0  0  0  0  0  0  
6  0  1  0  3  0  10  0  3  0  1  0  
7  0  0  0  0  0  0  0  0  0  0  0  
8  0  0  2  0  0  10  0  0  2  0  0  
9  0  0  0  3  0  0  0  3  0  0  0  
10  0  0  0  0  0  5  0  0  0  0  0  
11  0  0  0  0  0  0  0  0  0  0  0  
12  1  1  1  1  1  1  1  1  1  1  1 
A curious numeric pattern
You'll notice that in the list of scales exhibiting rotational symmetry, many have a decimal representation that ends with the digit 5. A closer look shows that the pattern exists for all scales that have symmetry on axes of 6, 4, and 2  where all the notes in the scale are in pairs a tritone apart. In the binary schema, each pair of notes that are a tritone apart add up to a multiple of 10, except for the root pair that adds up to 65. Therefore, all scales with rotational symmetry on the tritone will end with the digit 5.
1 + 64
= 65
2 + 128
= 130
4 + 256
= 260
8 + 512
= 520
16 + 1024
= 1040
32 + 2048
= 2080
Messiaen's Modes  and their truncations
The French composer Olivier Messiaen studied scales with rotational symmetry, because they are useful in creating sonorities with an ambiguous tonic. He famously named seven such modes, and asserted that they are the only ones that may exist; all other symmetrical scales are truncations of those. We can prove that Messiaen was correct, by putting every symmetrical scale into a chart of their truncation relationships.
In all of Messiaen's modes, the modes are regarded as identical, which makes sense because the whole point was to create ambiguous tonality. Therefore when we speak of one of the Messiaenic modes, we're talking about a whole modal family of scales, like this one which he labeled Mode 7:
Truncation is the process of removing notes from a scale, without affecting its symmetry. The concept is best explained by example. Let's take the mode which Messiaen called the Second Mode:
That scale is symmetrical along the axis of a 3semitone interval, i.e. by transposing it up a minor third. When we remove tones to create a truncation, we must preserve that symmetry, by removing four notes from the scale, like this:
In addition to the 3semitone symmetry, that scale is also symmetrical along the axis of a 6semitone interval. We can create two different truncations of 1755 that preserve that symmetry:
Technically, all of Messiaen's modes are truncated forms of 4095 , the 12tone scale, which is symmetrical at all intervals.
Hierarchy of truncations
This diagram illustrates that all symmetrical scales are truncations of the Messaienic modes (labeled "M" plus their number as assigned by Messaien). M1, M2, M3, and M7 are all truncations of the chromatic scale 4095; M2, M4, and M6 are truncations of M7; M1 and M5 are truncations of M6. M1 is also a truncation of M3, and M5 is also a truncation of M4. All the other rotationally symmetrical scales are labeled "T#" and are shown where they belong in the hierarchy of truncations.
Modal Family  Scales  is truncation of 

*  
Messiaen's Modes of Limited Transposition  
M1  *, M3, M6  
M2  *, M7  
M3  *  
M4  M7  
M5  M6, M4  
M6  M7  
M7  *  
Truncations  
T1  M2, T5, T4  
T2  M3  
T3  M1, T2  
T4  M2, M6, M4  
T5  M2, M6, M4  
T6  T4, T5, M5, M1 
 In this study we are ignoring sonorities that aren't like a "scale" by disallowing large interval leaps (see the first section). If we ignore those rules, what other truncated sets exist? (spoiler hint: not very many!)
 Does the naming of certain scales by Messiaen seem haphazard? Why did he name M5, which is merely a truncation of both M6 and M4, which are in turn truncations of M7?
Reflective Symmetry
A scale can be said to have reflective symmetry if it has an axis of reflection. If that axis falls on the root, then the scale will have the same interval pattern ascending and descending. A reflectively symmetrical scale, symmetrical on the axis of the root tone, is called a palindromic scale.
Here are all the scales that are palindromic:
Chirality
An object is chiral if it is distinguishable from its mirror image, and can't be transformed into its mirror image by rotation. Chirality is an important concept in knot theory, and also has applications in molecular chemistry.
The concept of chirality is apparent when you consider "handedness" of a shape, such as a glove. A pair of gloves has a left hand and a right hand, and you can't transform a left glove into a right one by flipping it over or rotating it. The glove, therefore, is a chiral object. Conversely, a sock can be worn by the right or left foot; the mirror image of a sock would still be the same sock. Therefore a sock is not a chiral object.
Palindromic scales are achiral. But not all nonpalindromic scales are chiral. For example, consider the scales 1105 and 325 (below). One is the mirror image (reflection) of the other. They are not palindromic scales. They are also achiral, because one can transform into the other by rotation.
The major scale is achiral. If you reflect the major scale, you get the phrygian scale; these two scales are modes (rotations) of each other. Therefore neither of them are chiral. Similarly, none of the other ecclesiastical major modes are chiral.
What makes chirality interesting? For one thing chirality indicates that a scale does not have any symmetry along any axis. If you examine all achiral scales, they will all have some axis of reflective symmetry  it's just not necessarily the root tone (which would make it palindromic).
A chiral object and its mirror image are called enantiomorphs. (source)
Scale  Name  Chirality / Enantiomorph 

273 (Augmented Triad)  Augmented Triad  achiral 
585 (Diminished Seventh)  Diminished Seventh  achiral 
661 (Major Pentatonic)  Major Pentatonic  achiral 
859 (Ultralocrian)  Ultralocrian  2905 (Aeolian flat 1) 
1193 (Minor Pentatonic)  Minor Pentatonic  achiral 
1257 (Blues scale)  Blues scale  741 
1365 (Wholetone)  Wholetone  achiral 
1371 (Superlocrian)  Superlocrian  achiral 
1387 (Locrian)  Locrian  achiral 
1389 (Minor Locrian)  Minor Locrian  achiral 
1397 (Major Locrian)  Major Locrian  achiral 
1451 (Phrygian)  Phrygian  achiral 
1453 (Aeolian)  Aeolian  achiral 
1459 (Phrygian Dominant)  Phrygian Dominant  2485 (Harmonic Major) 
1485 (Minor Romani)  Minor Romani  1653 (Minor Romani inverse) 
1493 (Lydian Minor)  Lydian Minor  achiral 
1499 (Bebop Locrian)  Bebop Locrian  2933 
1621 (Prometheus (Scriabin))  Prometheus (Scriabin)  1357 (Takemitsu Tree Line mode 2) 
1643 (Locrian natural 6)  Locrian natural 6  2765 (Lydian Diminished) 
1709 (Dorian)  Dorian  achiral 
1717 (Mixolydian)  Mixolydian  achiral 
1725 (Minor Bebop)  Minor Bebop  achiral 
1741 (Altered Dorian)  Altered Dorian  1645 (Dorian flat 5) 
1749 (Acoustic)  Acoustic  achiral 
1753 (Hungarian Major)  Hungarian Major  877 (Moravian Pistalkova) 
1755 (Octatonic)  Octatonic  achiral 
2257 (Lydian Pentatonic)  Lydian Pentatonic  355 
2275 (Messiaen Mode 5)  Messiaen Mode 5  achiral 
2457 (Major Augmented)  Major Augmented  achiral 
2475 (Neapolitan Minor)  Neapolitan Minor  2739 (Mela Suryakanta) 
2477 (Harmonic Minor)  Harmonic Minor  1715 (Harmonic Minor inverse) 
2483 (Double Harmonic)  Double Harmonic  achiral 
2509 (Double Harmonic Minor)  Double Harmonic Minor  achiral 
2535 (Messiaen mode 4)  Messiaen mode 4  achiral 
2731 (Neapolitan Major)  Neapolitan Major  achiral 
2733 (Melodic Minor ascending)  Melodic Minor ascending  achiral 
2741 (Major)  Major  achiral 
2773 (Lydian)  Lydian  achiral 
2777 (Aeolian Harmonic)  Aeolian Harmonic  875 (Locrian Doubleflat 7) 
2869 (Ionian Augmented)  Ionian Augmented  1435 (Makam Huzzam) 
2901 (Lydian Augmented)  Lydian Augmented  achiral 
2925 (Diminished)  Diminished  achiral 
2989 (Bebop Minor)  Bebop Minor  1723 (JG Octatonic) 
2997 (Major Bebop)  Major Bebop  achiral 
3055 (Messiaen mode 7)  Messiaen mode 7  achiral 
3411 (Enigmatic)  Enigmatic  2391 
3445 (Messiaen mode 6 inverse)  Messiaen mode 6 inverse  achiral 
3549 (Messiaen mode 3 inverse)  Messiaen mode 3 inverse  achiral 
3765 (Dominant Bebop)  Dominant Bebop  achiral 
4095 (Chromatic)  Chromatic  achiral 
 Reflective symmetry can occur with an axis on other notes of the scale. Are those interesting?
 The reflection axis can be on a tone, or between two tones. Is that interesting?
 Is there a more optimal or elegant way to find the reflective symmetry axes of a scale?
 Are there chiral enantiomorph pairs that are both named scales?
Combined Symmetry
Using similar methods to those above, we can identify all the scales that are both palindromic and have rotational symmetry. Here they are:
Balance
We assert a scale is "balanced", if the distribution of tones arranged around a 12spoke wheel would balance on its centre. This is related to the wellknown problem in mathematics known as the "balanced centrifuge problem".
There are 47 balanced scales. Here they are:
Interval Spectrum / Richness / Interval Vector
Howard Hanson, in the book "Harmonic Materials"^{2}, posits that the character of a sonority is defined by the intervals that are within it. This definition is also called an "Interval Vector"^{3} or "Interval Class Vector" in Pitch Class Set theory. Furthermore, in his system an interval is equivalent to its inverse, i.e. the sonority of a perfect 5th is the same as the perfect 4th. Hanson categorizes all intervals as being one of six classes, and gives each a letter: p m n s d t, ordered from most consonant (p) to most dissonant (t). When an interval appears more than once in a sonority, it is superscripted with a number, like p^{2}.
P  the Perfects (5 or 7)
This is the interval of a perfect 5th, or perfect 4th.
M  The Major Third (4 or 8)
This is the interval of a major 3rd, or minor 6th
N  The Minor Third (3 or 9)
This is the interval of a minor 3rd, or a major 6th
S  the second (2 or 10)
This is the interval of a major 2nd, or minor 7th
D  the Diminished (1 or 11)
Intervals of a minor 2nd, or a major 7th
T  the Tritone (6 semitones)
For example, in Hanson's analysis, a C major triad has the sonority pmn, because it contains one perfect 5th between the C and G (p), a major third between C and E (m), and a minor third between the E and G (n). Interesting to note that a minor triad of ACE is also a pmn sonority, just with the arrangement of the minor and major intervals swapped. The diminished seventh chord 585 has the sonority n^{4}t^{2} because it contains four different minor thirds, and two tritones.
We can count the appearances of an interval using a method called "cyclic autocorrelation". To find out how many of interval X appear in a scale, we rotate a copy of the scale by X degrees, and then count the number of positions where an "on" bit appears in both the original and copy.
All members of the same modal family will have the same interval spectrum, because the spectrum doesn't care about rotation, and modes are merely rotations of each other. And there will be many examples of different families that have the same interval spectrum  for example, 281 and 275 both have the spectrum "pm^{3}nd", but they are not modes of each other.
Below is a table of some of the named scales, and their interval spectrum. You'll notice that modal families will all have the same spectrum; hence every named mode of the diatonic scale (lydian, dorian, phrygian etc.) has the same spectrum of p^{6}m^{3}n^{4}s^{5}d^{2}t
273 (Augmented Triad)  m^{3} 
585 (Diminished Seventh)  n^{4}t^{2} 
661 (Major Pentatonic)  p^{4}mn^{2}s^{3} 
859 (Ultralocrian)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
1193 (Minor Pentatonic)  p^{4}mn^{2}s^{3} 
1257 (Blues scale)  p^{4}m^{2}n^{3}s^{3}d^{2}t 
1365 (Wholetone)  m^{6}s^{6}t^{3} 
1371 (Superlocrian)  p^{4}m^{4}n^{4}s^{5}d^{2}t^{2} 
1387 (Locrian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
1389 (Minor Locrian)  p^{4}m^{4}n^{4}s^{5}d^{2}t^{2} 
1397 (Major Locrian)  p^{2}m^{6}n^{2}s^{6}d^{2}t^{3} 
1451 (Phrygian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
1453 (Aeolian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
1459 (Phrygian Dominant)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
1485 (Minor Romani)  p^{4}m^{5}n^{3}s^{4}d^{3}t^{2} 
1493 (Lydian Minor)  p^{2}m^{6}n^{2}s^{6}d^{2}t^{3} 
1499 (Bebop Locrian)  p^{5}m^{5}n^{6}s^{5}d^{4}t^{3} 
1621 (Prometheus (Scriabin))  p^{2}m^{4}n^{2}s^{4}dt^{2} 
1643 (Locrian natural 6)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
1709 (Dorian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
1717 (Mixolydian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
1725 (Minor Bebop)  p^{7}m^{4}n^{5}s^{6}d^{4}t^{2} 
1741 (Altered Dorian)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
1749 (Acoustic)  p^{4}m^{4}n^{4}s^{5}d^{2}t^{2} 
1753 (Hungarian Major)  p^{3}m^{3}n^{6}s^{3}d^{3}t^{3} 
1755 (Octatonic)  p^{4}m^{4}n^{8}s^{4}d^{4}t^{4} 
2257 (Lydian Pentatonic)  p^{3}m^{2}nsd^{2}t 
2275 (Messiaen Mode 5)  p^{4}m^{2}s^{2}d^{4}t^{3} 
2457 (Major Augmented)  p^{3}m^{6}n^{3}d^{3} 
2475 (Neapolitan Minor)  p^{4}m^{5}n^{3}s^{4}d^{3}t^{2} 
2477 (Harmonic Minor)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
2483 (Double Harmonic)  p^{4}m^{5}n^{4}s^{2}d^{4}t^{2} 
2509 (Double Harmonic Minor)  p^{4}m^{5}n^{4}s^{2}d^{4}t^{2} 
2535 (Messiaen mode 4)  p^{6}m^{4}n^{4}s^{4}d^{6}t^{4} 
2731 (Neapolitan Major)  p^{2}m^{6}n^{2}s^{6}d^{2}t^{3} 
2733 (Melodic Minor ascending)  p^{4}m^{4}n^{4}s^{5}d^{2}t^{2} 
2741 (Major)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
2773 (Lydian)  p^{6}m^{3}n^{4}s^{5}d^{2}t 
2777 (Aeolian Harmonic)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
2869 (Ionian Augmented)  p^{4}m^{4}n^{5}s^{3}d^{3}t^{2} 
2901 (Lydian Augmented)  p^{4}m^{4}n^{4}s^{5}d^{2}t^{2} 
2925 (Diminished)  p^{4}m^{4}n^{8}s^{4}d^{4}t^{4} 
2989 (Bebop Minor)  p^{5}m^{5}n^{6}s^{5}d^{4}t^{3} 
2997 (Major Bebop)  p^{6}m^{5}n^{6}s^{5}d^{4}t^{2} 
3055 (Messiaen mode 7)  p^{8}m^{8}n^{8}s^{8}d^{8}t^{5} 
3411 (Enigmatic)  p^{4}m^{4}n^{3}s^{5}d^{3}t^{2} 
3445 (Messiaen mode 6 inverse)  p^{4}m^{6}n^{4}s^{6}d^{4}t^{4} 
3549 (Messiaen mode 3 inverse)  p^{6}m^{9}n^{6}s^{6}d^{6}t^{3} 
3765 (Dominant Bebop)  p^{7}m^{4}n^{5}s^{6}d^{4}t^{2} 
4095 (Chromatic)  p^{12}m^{12}n^{12}s^{12}d^{12}t^{6} 
 Is there an optimal or elegant way to find all scales with a given spectrum?
 What patterns appear in interval distribution?
 Which are the most common, and least common spectra?
Evenness
Another interesting property of a scale is whether the notes are evenly spaced, or clumped together. The theory of musical scale evenness owes to "Diatonic Set Theory", the work of Richard Krantz and Jack Douhett^{4}. In their paper, they explain how you can determine the "evenness" of a scale, first by establishing the intervals between each note and every other.
To measure the evenness of the scale, the first step is to build the distribution spectra. The spectra shows the distinct specific intervals between notes, for each generic interval of the scale. Each spectrum is notated like this:
<generic interval> = { specific interval, specific interval, ...}
The number in angle brackets is the generic interval, ie we are asking "for notes that are this many steps away in the scale". The numbers in curly brackets are the specific intervals we find present for those steps, ie "between those steps we find notes that are this many semitones apart".
It's best explained with an example. Below is the scale bracelet diagram and distribution spectra for Scale 1449:
Scale  Notes  Distribution Spectra 

<1> = {1,2,3} <2> = {3,4,5} <3> = {5,7} <4> = {7,8,9} <5> = {9,10,11} 
In line 1, the first spectrum, <1> indicates that we are looking at notes that are one scale step away from each other. We have notes that are one semitone apart (eg G and G#), two semitones (D# and F), and three semitones (C and D#). Duplicates of these are ignored; we merely want to know what intervals are present, not how many of them exist.
In line 2, the second spectrum, <2> indicates that we are looking at notes that are two scale steps away from each other. We see pairs that are three semitones apart (eg F and G#), four semitones (D# and G), and five semitones (C and F).
When there is more than one specific interval, the spectrum width is the difference between the largest and smallest value. For example for the <3> spectrum above, the specific intervals are {5,7} and so its width is 2, which is 7 minus 5.
The spectrum variation is the average of all those widths.
Once the distribution specta are built, we analyze them to discover interesting properties of the scale. For instance,
 If all the spectra have just one specific interval, then the scale has exactly equal distribution
 If the spectra have two intervals with a difference no greater than one, then the scale is maximally even  it's distributed as evenly as it can be with no room for improvement.
 If the spectra has any widths greater than 1, then it's not maximally even.
 If there are exactly two specific intervals in all the spectra, then the scale is said to have Myhill's property.
Ultimately, the measure of a scale's evenness is its Spectra Variation. We add up all the spectrum widths, and divide by the number of tones in the scale, to achieve an average width with respect to the scale size. If a scale has perfectly spaced notes with completely uniform evenness, then it has a spectra variation of zero. A higher variation means the scale distribution is less even.
The following four scales have a perfect score  a spectra variation of zero:
Obviously, it is possible to evenly distribute 6 tones around a 12tone scale. But it is impossible to do that with a 5 tone (pentatonic) or 7 tone (heptatonic) scale. For such tone counts all we can hope to achieve is an optimally even distribution.
Below are all the prime scales (ie with rotations omitted), sorted from most even to least even. If you click to each scale detail page, you can read its spectra variation there.
3 tones
4 tones
5 tones
6 tones
7 tones
8 tones
9 tones
10 tones
11 tones
12 tones
Myhill's Property
Myhill's Property is the quality of a pitch class set where the spectrum has exactly two specific intervals for every generic interval. There are 47 scales with Myhill's property:
Propriety / Coherence
A scale is said to have "Rothenberg propriety", a quality named after David Rothenberg^{5}, if the scale has unambiguous relationship between generic intervals (scale degrees) and specific intervals. The same concept was discovered by Gerald Balzano, who named it coherence.
To be proper (aka coherent), every twostep generic interval must be specifically larger than every onestep generic interval, every threestep generic interval must be specifically larger than every twostep, and so on. This means that when hearing any interval from within a scale, you can unambiguously know what generic distance it is within the scale.
You can see the coherence of a scale by inspecting its distribution spectra. Look at this scale:
Scale  Notes  Distribution Spectra 

<1> = {1,2,3} <2> = {3,4,5} <3> = {5,7} <4> = {7,8,9} <5> = {9,10,11} 
You can see that if you hear an interval of 2 semitones, that is unambiguously a onestep generic distance. We know this because the specific distance of 2 appears in the spectra only in the 1step spectrum.
Contrarily, if we know that our scale is 1449 rooted on C, and we hear an interval of 5 semitones (a perfect fourth), this could be a generic distance of a two steps (between C and F), or it might be a generic distance of three steps (between D# and G#). That ambiguity means this scale is not coherent.
There are exactly 31 coherent scales. Here they are:
Deep Scales
A "deep" scale is one for which the evenness distribution spectrum of specific intervals consists of unique values. There are only 13 deep scales. Here they are:
Hemitonia and Tritonia
One interesting approach to understanding scales is to look at the distribution of consonant and dissonant intervals in the scale. We did this already in the "spectrum analysis" above, but two intervals in particular are commonly regarded in more depth: tritones and semitones  which are deemed the most dissonant of intervals, and those that give a scale its spice and flavour.
A scale that contains semitones is called "hemitonic", and we will also refer to a hemitonic as the scale member that has the upper semitone neighbour (for example, mifa and tido in a major scale, the hemitones are mi and fa).
A scale that contains tritones is called "tritonic", and we will also refer to a tritonic as the scale member that has a tritone above it. This concept seems very close to the notion of "imperfection" (explained below)
Since hemitonia and tritonia are based on the interval spectrum, all the modes of a scale will have the same hemitonia. For example, the major scale is dihemitonic and ancohemitonic; thus so are dorian, phrygian, lydian, etc.
Number of tones  # of Hemitonic Scales  # of Tritonic Scales 

3  0  0 
4  12  24 
5  140  150 
6  335  335 
7  413  413 
8  322  322 
9  165  165 
10  55  55 
11  11  11 
12  1  1 
It's well to know that so many scales are hemitonic and tritonic (having more than zero semitones or tritones), but obviously some scales are more hemitonic than others. A scale could have no hemitonics ("ahemitonic"), one ("unihemitonic"), two ("dihemitonic"), three ("trihemitonic") and so on. Let's look at the count of hemitones in our scales.
Number of hemitones  

tones in scale  0  1  2  3  4  5  6  7  8  9  10  11  12 
3  1  0  0  0  0  0  0  0  0  0  0  0  0 
4  19  12  0  0  0  0  0  0  0  0  0  0  0 
5  15  80  60  0  0  0  0  0  0  0  0  0  0 
6  1  30  150  140  15  0  0  0  0  0  0  0  0 
7  0  0  21  140  210  42  0  0  0  0  0  0  0 
8  0  0  0  0  70  168  84  0  0  0  0  0  0 
9  0  0  0  0  0  0  84  72  9  0  0  0  0 
10  0  0  0  0  0  0  0  0  45  10  0  0  0 
11  0  0  0  0  0  0  0  0  0  0  11  0  0 
12  0  0  0  0  0  0  0  0  0  0  0  0  1 
Fun fact: there are no scales with 11 hemitones. Do you understand why?
Number of tritones  

tones in scale  0  1  2  3  4  5  6  7  8  9  10  11  12 
3  1  0  0  0  0  0  0  0  0  0  0  0  0 
4  7  16  8  0  0  0  0  0  0  0  0  0  0 
5  5  40  75  30  5  0  0  0  0  0  0  0  0 
6  1  12  102  146  69  6  0  0  0  0  0  0  0 
7  0  0  14  112  196  84  7  0  0  0  0  0  0 
8  0  0  0  0  62  168  84  8  0  0  0  0  0 
9  0  0  0  0  0  0  84  72  9  0  0  0  0 
10  0  0  0  0  0  0  0  0  45  10  0  0  0 
11  0  0  0  0  0  0  0  0  0  0  11  0  0 
12  0  0  0  0  0  0  0  0  0  0  0  0  1 
Cohemitonia
Cohemitonia is the presense of two semitones consecutively in scale order. For instance, if a scale has three cromatically consecutive notes, then it is cohemitonic. We will also refer to the cehemitonic as the tone that has two semitone neighbours above it.
Modes
There is a lot of confusion about what is a "mode", chiefly because the word is used slightly differently in various contexts.
When we say "C major", the word "major" refers to a specific pattern of whole and halfsteps. The "C" tells us to begin that pattern on the root tone of "C".
Modes are created when you use the same patterns of whole and halfsteps, but you begin on a different step. For instance, the "D Dorian" mode uses all the same notes as C major (the white keys on a piano), but it begins with D. Compared with the Major (also known as "Ionian" mode), the Dorian sounds different, because relative to the root note D, it has a minor third and a minor seventh.
The best way to understand modes is to think of a toy piano where the black keys are just painted on  all you have are the white keys: C D E F G A B. Can you play a song that sounds like it's in a minor key? You can't play a song in C minor, because that would require three flats. So instead you play the song with A as the root (A B C D E F G). That scale is a mode of the major scale, called the Aeolian Mode.
When you play that minor scale, you're not playing "C minor", you're playing the relative minor of C, which is "A minor". Modes are relatives of each other if they have the same pattern of steps, starting on different steps.
To compute a mode of the current scale, we "rotate" all the notes down one semitone. Then if the rotated notes have an on bit in the root, then it is a mode of the original scale. It's as if you take the bracelet diagram that we've been using throughout this study, and twist it like a dial so that a different note is at the top, in the root position.
101010110101 = 2741  major scale, "ionian" mode 110101011010 = 3418  rotated down 1 semitone  not a scale 011010101101 = 1709  rotated down 2 semitones  "dorian" 101101010110 = 2902  rotated down 3 semitones  not a scale 010110101011 = 1451  rotated down 4 semitones  "phrygian" 101011010101 = 2773  rotated down 5 semitones  "lydian" 110101101010 = 3434  rotated down 6 semitones  not a scale 011010110101 = 1717  rotated down 7 semitones  "mixolydian" 101101011010 = 2906  rotated down 8 semitones  not a scale 010110101101 = 1453  rotated down 9 semitones  "aeolian" 101011010110 = 2774  rotated down 10 semitones  not a scale 010101101011 = 1387  rotated down 11 semitones  "locrian"
When we do this to every scale, we see modal relationships between scales, and we also discover symmetries when a scale is a mode of itself on another degree.
Prime Form
Often when discussing the properties of a scale, those properties (like interval distribution or evenness) are the same for all related scales, ie a scale, all its the modes, its inverse, and the modes of its inverse. In order to simplify things, it is useful to declare that one of those is the "prime form", so when doing analysis we discard all of them except one.
It's important to emphasize  because this point is sometimes missed  that the interval distribution in a scale is the same for all the scale's modes produced by rotation, but also for the scale's inverse produced by reflection. The prime form of a scale is chosen to represent the entire group of scales with equivalent interval patterns.
In discussing Prime Form of a scale, we are undeniably treading into the topic of Pitch Class Sets, a more generalized study involving every possible combination of tones, regardless of the rules that make it a scale.
Forte vs Rahn
There are two dominant strategies for declaring the Prime Form of a set of tones; one was defined by Allen Forte^{6}, and another similar one (with only subtle differences) described later by John Rahn^{7}. While I have deep admiration for Forte's theoretical work, I prefer the Rahn prime formula, for the simple reason that the Rahn primes are the easier to calculate.
The calculation of the Prime Form according to Forte requires some inelegant cyclomatic complexity. Contrarily, computing the Rahn Prime Form is remarkably simple: The Rahn Prime Form is the one with the lowest value when expressed in bits, as we have done in this study. This connection between Rahn's prime forms and the bit representation of a scale was proven by me (Ian Ring) in 2017, by brute force calculation of every possible scale and prime form according to both algorithms.
In a necessarily succinct overview of this topic, I'll demonstrate the differences between Forte's algoroth and Rahn's. The prime form for pitch class sets is identical except for 6 sets. Both algorithms look at the distance between the first and last tones of the set, preferring the one with the smaller interval. In the case of a tie, this is where Forte and Rahn differ: Forte begins at the start of the set working toward the end, whereas Rahn starts at the end working toward the beginning.
Here are the six sets where Forte and Rahn disagree on which one is prime.
Forte  Rahn 

{0,1,3,7,8}  {0,1,5,6,8} 
{0,1,3,5,8,9}  {0,1,4,5,7,9} 
{0,1,3,6,8,9}  {0,2,3,6,7,9} 
{0,1,2,4,7,8,9}  {0,1,2,5,6,7,9} 
{0,1,2,3,5,8,9}  {0,1,4,5,6,7,9} 
{0,1,2,4,5,7,9,10}  {0,1,3,4,5,7,8,10} 
A complete list of all modal families
Modal families with 3 tones
m^{3}  273 (Augmented Triad) 
Modal families with 4 tones
pm^{3}nd  281 401 547 2321 
p^{2}m^{2}nd  291 (Raga Lavangi) 393 561 2193 
pm^{3}nd  275 305 785 2185 
m^{3}s^{2}t  277 337 1093 1297 
pmn^{2}st  329 553 581 1169 (Raga Mahathi) 
p^{2}mn^{2}s  297 549 (Raga Bhavani) 657 1161 (Bi Yu) 
m^{2}s^{2}t^{2}  325 (Messiaen truncated mode 6) 1105 (Messiaen truncated mode 6 inverse) 
pmn^{2}st  293 (Raga Haripriya) 593 649 1097 
n^{4}t^{2}  585 (Diminished Seventh) 
Modal families with 5 tones
pm^{3}ns^{2}d^{2}t  285 465 1095 2595 3345 
p^{2}m^{2}n^{2}sd^{2}t  457 569 583 2339 (Raga Kshanika) 3217 
p^{2}m^{3}n^{2}sd^{2}  313 551 913 2323 3209 
p^{2}m^{2}s^{2}d^{2}t^{2}  327 453 1137 2211 (Raga Gauri) 3153 
p^{2}m^{2}n^{2}sd^{2}t  295 625 905 2195 3145 
pm^{3}ns^{2}d^{2}t  279 369 1809 2187 3141 
p^{2}m^{3}n^{2}sd^{2}  283 433 (Raga Zilaf) 1571 2189 2833 
p^{3}m^{2}n^{2}s^{2}d  425 (Raga Kokil Pancham) 565 1165 1315 2705 (Raga Mamata) 
pm^{3}n^{2}s^{2}dt  309 849 1101 1299 2697 
p^{3}mn^{2}s^{2}dt  421 (Hankumoi) 653 (Dorian Pentatonic) 1129 (Raga Jayakauns) 1187 (Kokinjoshi) 2641 (Raga Hindol) 
pmn^{4}sdt^{2}  589 617 841 1171 (Raga Manaranjani I) 2633 
p^{2}mn^{3}s^{2}dt  361 557 (Raga Abhogi) 1163 (Raga Rukmangi) 1681 (Raga Valaji) 2629 (Raga Shubravarni) 
p^{3}m^{2}nsd^{2}t  397 (Hirajoshi) 419 (Honkumoijoshi) 1123 (Iwato) 2257 (Lydian Pentatonic) 2609 (Raga Bhinna Shadja) 
pm^{2}n^{2}s^{2}dt^{2}  333 837 1107 1233 2601 (Raga Chandrakauns) 
p^{2}mn^{3}s^{2}dt  301 (Raga Audav Tukhari) 721 (Raga Dhavalashri) 1099 1673 2597 (Raga Rasranjani) 
p^{2}m^{4}n^{2}d^{2}  409 563 803 2329 2449 
p^{2}m^{4}n^{2}d^{2}  307 (Raga Megharanjani) 787 817 2201 2441 
p^{2}m^{3}ns^{2}dt  405 (Raga Bhupeshwari) 675 (Altered Pentatonic) 1125 1305 2385 
p^{2}m^{2}n^{3}sdt  613 659 (Raga Rasika Ranjani) 809 1177 2377 
pm^{2}n^{2}s^{2}dt^{2}  357 651 1113 (Locrian Pentatonic 2) 1617 2373 
p^{2}m^{3}n^{2}d^{2}t  403 (Raga Reva) 611 793 2249 (Raga Multani) 2353 (Raga Girija) 
p^{2}m^{2}n^{3}sdt  595 665 (Raga Mohanangi) 805 1225 (Raga Samudhra Priya) 2345 (Raga Chandrakauns) 
pmn^{4}sdt^{2}  587 601 713 1609 2341 (Raga Priyadharshini) 
pm^{3}n^{2}s^{2}dt  345 555 1425 1605 2325 
p^{3}m^{2}nsd^{2}t  355 395 (Balinese) 1585 (Raga Khamaji Durga) 2225 (Ionian Pentatonic) 2245 (Raga Vaijayanti) 
p^{2}m^{3}ns^{2}dt  339 789 1221 1329 2217 (Raga Nata) 
p^{3}mn^{2}s^{2}dt  331 (Raga Chhaya Todi) 709 (Raga Shri Kalyan) 1201 (Mixolydian Pentatonic) 1577 (Raga Chandrakauns (Kafi)) 2213 (Raga Desh) 
p^{3}m^{2}n^{2}s^{2}d  299 (Raga Chitthakarshini) 689 (Raga Nagasvaravali) 1417 (Raga Shailaja) 1573 (Raga Guhamanohari) 2197 (Raga Hamsadhvani) 
m^{4}s^{4}t^{2}  341 1109 1301 1349 1361 
p^{2}m^{2}n^{2}s^{3}t  597 (Kung) 681 (Kyemyonjo) 1173 (Dominant Pentatonic) 1317 (Chaio) 1353 (Raga Harikauns) 
p^{4}mn^{2}s^{3}  661 (Major Pentatonic) 677 (Scottish Pentatonic) 1189 (Suspended Pentatonic) 1193 (Minor Pentatonic) 1321 (Blues Minor) 
Modal families with 6 tones
p^{2}m^{3}n^{2}s^{3}d^{4}t  287 497 2191 3143 3619 3857 
p^{3}m^{2}n^{3}s^{3}d^{3}t  489 573 1167 2631 3363 3729 
p^{2}m^{3}n^{3}s^{3}d^{3}t  317 977 1103 2599 3347 3721 
p^{3}m^{2}n^{2}s^{3}d^{3}t^{2}  485 655 1145 2375 3235 3665 
p^{2}m^{2}n^{4}s^{2}d^{3}t^{2}  591 633 969 2343 3219 3657 
p^{2}m^{3}n^{3}s^{3}d^{3}t  377 559 1937 2327 3211 3653 
p^{4}m^{2}ns^{2}d^{4}t^{2}  399 483 2247 (Raga Vijayasri) 2289 3171 3633 
p^{3}m^{2}n^{2}s^{3}d^{3}t^{2}  335 965 1265 2215 3155 3625 
p^{3}m^{2}n^{3}s^{3}d^{3}t  303 753 1929 2199 3147 3621 
p^{2}m^{4}n^{3}s^{2}d^{3}t  473 571 1607 2333 2851 3473 
p^{3}m^{4}n^{3}s^{2}d^{3}  315 945 (Raga Saravati) 1575 2205 2835 3465 
p^{2}m^{4}ns^{4}d^{2}t^{2}  469 1141 1309 1351 2723 (Raga Jivantika) 3409 
p^{3}m^{3}n^{3}s^{3}d^{2}t  629 937 1181 1319 2707 3401 
pm^{4}n^{2}s^{4}d^{2}t^{2}  373 1117 1303 1873 2699 3397 
p^{3}m^{3}n^{2}s^{2}d^{3}t^{2}  467 (Raga Dhavalangam) 797 1223 2281 2659 3377 
p^{4}m^{2}n^{3}s^{3}d^{2}t  669 933 1191 1257 (Blues scale) 2643 (Raga Hamsanandi) 3369 
p^{2}m^{2}n^{4}s^{3}d^{2}t^{2}  605 745 1175 1865 2635 3365 
p^{3}m^{4}n^{2}s^{2}d^{3}t  413 931 (Raga Kalakanthi) 1127 2513 2611 (Raga Vasanta) 3353 
pm^{4}n^{2}s^{4}d^{2}t^{2}  349 1111 1489 (Raga Jyoti) 1861 2603 3349 
p^{3}m^{3}n^{2}s^{2}d^{3}t^{2}  461 (Raga Syamalam) 839 1139 2467 (Raga Padi) 2617 3281 (Raga Vijayavasanta) 
p^{3}m^{4}n^{3}sd^{3}t  627 807 (Raga Suddha Mukhari) 921 2361 2451 (Raga Bauli) 3273 (Raga Jivantini) 
p^{3}m^{4}n^{2}s^{2}d^{3}t  371 791 1841 2233 2443 3269 (Raga Malarani) 
p^{4}m^{2}n^{2}s^{2}d^{3}t^{2}  459 711 (Raga Chandrajyoti) 1593 2277 2403 3249 (Raga Tilang) 
p^{4}m^{3}n^{2}s^{3}d^{2}t  679 917 1253 1337 2387 3241 
p^{4}m^{2}n^{3}s^{3}d^{2}t  663 741 1209 (Raga Bhanumanjari) 1833 2379 (Raga Gurjari Todi) 3237 (Raga Brindabani Sarang) 
p^{3}m^{4}n^{3}sd^{3}t  615 825 915 (Raga Kalagada) 2355 (Raga Lalita) 2505 3225 
p^{3}m^{3}n^{3}s^{3}d^{2}t  599 697 1481 1829 2347 (Raga Viyogavarali) 3221 
p^{3}m^{4}n^{3}s^{2}d^{3}  441 567 1827 2331 2961 3213 
p^{4}m^{2}s^{2}d^{4}t^{3}  455 (Messiaen mode 5) 2275 (Messiaen Mode 5) 3185 (Messiaen mode 5 inverse) 
p^{4}m^{2}n^{2}s^{2}d^{3}t^{2}  423 909 1251 2259 (Raga Mandari) 2673 3177 
p^{3}m^{3}n^{2}s^{2}d^{3}t^{2}  407 739 1817 2251 2417 3173 
p^{3}m^{3}n^{2}s^{2}d^{3}t^{2}  359 907 1649 2227 (Raga Gaula) 2501 3161 
p^{2}m^{4}ns^{4}d^{2}t^{2}  343 1393 1477 (Raga Jaganmohanam) 1813 2219 3157 
p^{2}m^{4}n^{3}s^{2}d^{3}t  311 881 1811 2203 2953 3149 
p^{3}m^{3}n^{3}s^{3}d^{2}t  437 1133 1307 1699 (Raga Rasavali) 2701 (Hawaiian) 2897 
p^{2}m^{2}n^{5}s^{2}d^{2}t^{2}  621 (Pyramid Hexatonic) 873 1179 1683 (Raga Malayamarutam) 2637 (Raga Ranjani) 2889 
p^{2}m^{2}n^{4}s^{3}d^{2}t^{2}  365 1115 (Superlocrian Hexamirror) 1675 (Raga Salagavarali) 1745 (Raga Vutari) 2605 2885 
p^{3}m^{4}n^{3}sd^{3}t  435 (Raga Purna Pancama) 795 1635 2265 (Raga Rasamanjari) 2445 2865 
p^{2}m^{3}n^{4}s^{2}d^{2}t^{2}  667 869 1241 1619 (Prometheus Neapolitan) 2381 (Takemitsu Tree Line mode 1) 2857 
p^{2}m^{2}n^{5}s^{2}d^{2}t^{2}  603 729 1611 1737 (Raga Madhukauns) 2349 (Raga Ghantana) 2853 
p^{3}m^{4}n^{3}sd^{3}t  411 867 1587 (Raga Rudra Pancama) 2253 (Raga Amarasenapriya) 2481 (Raga Paraju) 2841 
p^{3}m^{3}n^{3}s^{3}d^{2}t  347 1457 (Raga Kamalamanohari) 1579 1733 (Raga Sarasvati) 2221 (Raga Sindhura Kafi) 2837 
p^{4}m^{2}n^{3}s^{3}d^{2}t  429 1131 (Honchoshi plagal form) 1443 (Raga Phenadyuti) 1677 (Raga Manavi) 2613 (Raga Hamsa Vinodini) 2769 
p^{2}m^{3}n^{4}s^{2}d^{2}t^{2}  619 (DoublePhrygian Hexatonic) 857 1427 1613 2357 (Raga Sarasanana) 2761 
p^{4}m^{2}n^{3}s^{3}d^{2}t  363 1419 (Raga Kashyapi) 1581 (Raga Bagesri) 1713 (Raga Khamas) 2229 (Raga Nalinakanti) 2757 (Raga Nishadi) 
p^{4}m^{3}n^{2}s^{3}d^{2}t  427 (Raga Suddha Simantini) 1379 1421 (Raga Trimurti) 1589 (Raga Rageshri) 2261 (Raga Caturangini) 2737 (Raga Hari Nata) 
p^{2}m^{4}n^{2}s^{4}dt^{2}  853 1237 1333 1357 (Takemitsu Tree Line mode 2) 1363 2729 
p^{4}m^{2}n^{3}s^{4}dt  725 (Raga Yamuna Kalyani) 1205 (Raga Siva Kambhoji) 1325 1355 (Raga Bhavani) 1705 (Raga Manohari) 2725 (Raga Nagagandhari) 
p^{3}m^{4}n^{3}s^{2}d^{2}t  821 851 (Raga Hejjajji) 1229 (Raga Simharava) 1331 (Raga Vasantabhairavi) 2473 (Raga Takka) 2713 
p^{5}m^{2}n^{3}s^{4}d  693 (Arezzo Major Diatonic Hexachord) 1197 (Minor Hexatonic) 1323 (Ritsu) 1449 (Raga Gopikavasantam) 1701 (Dominant Seventh) 2709 (Raga Kumud) 
p^{2}m^{2}n^{4}s^{2}d^{2}t^{3}  845 (Raga Neelangi) 1235 (Messiaen truncated mode 2) 2665 
p^{3}m^{2}n^{4}s^{2}d^{2}t^{2}  723 813 1227 1689 2409 2661 
p^{3}m^{2}n^{4}s^{2}d^{2}t^{2}  717 (Raga Vijayanagari) 843 1203 1641 2469 (Raga Bhinna Pancama) 2649 
p^{4}m^{2}n^{3}s^{4}dt  685 (Raga Suddha Bangala) 1195 (Raga Gandharavam) 1385 1445 (Raga Navamanohari) 1685 2645 (Raga Mruganandana) 
p^{3}m^{6}n^{3}d^{3}  819 (Augmented Inverse) 2457 (Major Augmented) 
p^{3}m^{4}n^{3}s^{2}d^{2}t  691 (Raga Kalavati) 811 1433 1637 2393 2453 (Raga Latika) 
p^{2}m^{2}n^{4}s^{2}d^{2}t^{3}  715 (Messiaen truncated mode 2) 1625 2405 
p^{2}m^{4}n^{2}s^{4}dt^{2}  683 1369 1381 1429 1621 (Prometheus (Scriabin)) 2389 (Eskimo Hexatonic 2) 
m^{6}s^{6}t^{3}  1365 (Wholetone) 
Modal families with 7 tones
p^{3}m^{4}n^{4}s^{4}d^{5}t  505 575 2335 3215 3655 3875 3985 
p^{3}m^{4}n^{4}s^{4}d^{5}t  319 1009 2207 3151 3623 3859 3977 
p^{3}m^{4}n^{3}s^{5}d^{4}t^{2}  501 1149 1311 2703 3399 3747 3921 
p^{3}m^{3}n^{5}s^{4}d^{4}t^{2}  637 (Debussy's Heptatonic) 1001 1183 2639 3367 3731 3913 
p^{2}m^{4}n^{4}s^{5}d^{4}t^{2}  381 1119 2001 2607 3351 3723 3909 
p^{4}m^{4}n^{3}s^{3}d^{5}t^{2}  499 799 2297 2447 3271 (Mela Raghupriya) 3683 3889 
p^{4}m^{3}n^{4}s^{4}d^{4}t^{2}  671 997 1273 2383 3239 (Mela Tanarupi) 3667 3881 
p^{3}m^{3}n^{5}s^{4}d^{4}t^{2}  607 761 1993 2351 3223 3659 3877 
p^{4}m^{4}n^{3}s^{3}d^{5}t^{2}  415 995 2255 2545 3175 3635 3865 
p^{3}m^{4}n^{3}s^{5}d^{4}t^{2}  351 1521 1989 2223 3159 3627 3861 
p^{4}m^{3}n^{4}s^{4}d^{4}t^{2}  493 1147 1679 2621 2887 3491 3793 
p^{3}m^{4}n^{5}s^{3}d^{4}t^{2}  635 985 (Mela Sucaritra) 1615 2365 2855 3475 3785 
p^{4}m^{4}n^{4}s^{4}d^{4}t  379 1583 1969 2237 2839 3467 3781 
p^{5}m^{3}n^{3}s^{4}d^{4}t^{2}  491 1423 1597 2293 2759 (Mela Pavani) 3427 3761 (Raga Madhuri) 
p^{4}m^{4}n^{3}s^{5}d^{3}t^{2}  981 (Mela Kantamani) 1269 1341 1359 2727 (Mela Manavati) 3411 (Enigmatic) 3753 
p^{5}m^{3}n^{4}s^{5}d^{3}t  757 1213 1327 1961 2711 3403 3749 (Raga Sorati) 
p^{4}m^{4}n^{4}s^{3}d^{4}t^{2}  829 979 (Mela Dhavalambari) 1231 2537 2663 3379 (Verdi's Scala enigmatica descending) 3737 
p^{5}m^{3}n^{4}s^{5}d^{3}t  701 1199 1513 1957 2647 3371 3733 
p^{4}m^{4}n^{4}s^{4}d^{4}t  445 1135 1955 2615 3025 3355 3725 
p^{5}m^{3}n^{2}s^{3}d^{5}t^{3}  487 911 2291 2503 (Mela Jhalavarali) 3193 3299 3697 
p^{4}m^{3}n^{4}s^{3}d^{4}t^{3}  847 973 (Mela Syamalangi) 1267 2471 (Mela Ganamurti) 2681 3283 (Mela Visvambhari) 3689 
p^{4}m^{4}n^{4}s^{3}d^{4}t^{2}  755 815 1945 2425 2455 3275 (Mela Divyamani) 3685 
p^{4}m^{3}n^{4}s^{3}d^{4}t^{3}  719 971 (Mela Gavambodhi) 1657 2407 2533 3251 (Mela Hatakambari) 3673 
p^{4}m^{4}n^{3}s^{5}d^{3}t^{2}  687 1401 1509 1941 2391 3243 (Mela Rupavati) 3669 
p^{3}m^{4}n^{5}s^{3}d^{4}t^{2}  623 889 1939 2359 3017 3227 3661 
p^{5}m^{3}n^{2}s^{3}d^{5}t^{3}  463 967 (Mela Salaga) 2279 2531 3187 3313 3641 
p^{5}m^{3}n^{3}s^{4}d^{4}t^{2}  431 1507 1933 2263 2801 3179 3637 (Raga Rageshri) 
p^{4}m^{3}n^{4}s^{4}d^{4}t^{2}  367 1777 1931 2231 3013 3163 3629 
p^{3}m^{5}n^{3}s^{4}d^{4}t^{2}  477 1143 1863 2619 2979 3357 3537 
p^{4}m^{5}n^{4}s^{3}d^{4}t  631 953 (Mela Yagapriya) 1831 2363 2963 3229 3529 
p^{3}m^{5}n^{3}s^{4}d^{4}t^{2}  375 1815 1905 2235 2955 3165 3525 
p^{4}m^{4}n^{4}s^{3}d^{4}t^{2}  475 1595 1735 (Mela Navanitam) 2285 2845 2915 3505 
p^{5}m^{4}n^{4}s^{4}d^{3}t  949 (Mela Mararanjani) 1261 (Modified Blues) 1339 1703 (Mela Vanaspati) 2717 2899 3497 
p^{4}m^{3}n^{5}s^{4}d^{3}t^{2}  749 1211 1687 1897 2653 2891 3493 
p^{4}m^{6}n^{4}s^{2}d^{4}t  827 947 (Mela Gayakapriya) 1639 2461 2521 (Mela Dhatuvardhani) 2867 3481 
p^{3}m^{5}n^{4}s^{4}d^{3}t^{2}  699 1497 (Mela Jyotisvarupini) 1623 1893 2397 2859 3477 
p^{4}m^{5}n^{4}s^{3}d^{4}t  443 1591 1891 2269 2843 2993 3469 
p^{4}m^{4}n^{2}s^{4}d^{4}t^{3}  471 1479 (Mela Jalarnava) 1821 2283 2787 3189 3441 
p^{5}m^{3}n^{4}s^{4}d^{3}t^{2}  941 (Mela Jhankaradhvani) 1259 1447 (Mela Ratnangi) 1693 2677 2771 (Marva That) 3433 
p^{3}m^{4}n^{4}s^{4}d^{3}t^{3}  747 1431 1629 1881 2421 2763 (Mela Suvarnangi) 3429 
p^{4}m^{5}n^{3}s^{4}d^{3}t^{2}  939 (Mela Senavati) 1383 1437 (Sabach ascending) 1653 (Minor Romani inverse) 2517 (Harmonic Lydian) 2739 (Mela Suryakanta) 3417 
p^{2}m^{6}n^{2}s^{6}d^{2}t^{3}  1367 (Leading WholeTone inverse) 1373 1397 (Major Locrian) 1493 (Lydian Minor) 1877 2731 (Neapolitan Major) 3413 (Leading Wholetone) 
p^{3}m^{5}n^{4}s^{4}d^{3}t^{2}  885 1245 1335 1875 2715 2985 3405 
p^{5}m^{4}n^{3}s^{3}d^{4}t^{2}  925 (Chromatic Hypodorian) 935 (Chromatic Dorian) 1255 (Chromatic Mixolydian) 2515 (Chromatic Hypolydian) 2675 (Chromatic Lydian) 3305 (Chromatic Hypophrygian) 3385 (Chromatic Phrygian) 
p^{3}m^{4}n^{4}s^{4}d^{3}t^{3}  861 1239 1491 (Mela Namanarayani) 1869 2667 2793 3381 
p^{4}m^{3}n^{5}s^{4}d^{3}t^{2}  733 1207 1769 (Blues Heptatonic II) 1867 2651 2981 3373 
p^{5}m^{4}n^{3}s^{3}d^{4}t^{2}  743 (Chromatic Hypophrygian inverse) 919 (Chromatic Phrygian Inverse) 1849 (Chromatic Hypodorian inverse) 2419 (Raga Lalita) 2507 (Todi That) 3257 (Mela Calanata) 3301 (Chromatic Mixolydian inverse) 
p^{4}m^{5}n^{4}s^{2}d^{4}t^{2}  871 (Locrian Doubleflat 3 Doubleflat 7) 923 (Ultraphrygian) 1651 (Asian) 2483 (Double Harmonic) 2509 (Double Harmonic Minor) 2873 (Ionian Augmented Sharp 2) 3289 (Lydian Sharp 2 Sharp 6) 
p^{4}m^{5}n^{3}s^{4}d^{3}t^{2}  855 1395 (Asian (a)) 1485 (Minor Romani) 1845 2475 (Neapolitan Minor) 2745 (Mela Sulini) 3285 (Mela Citrambari) 
p^{4}m^{6}n^{4}s^{2}d^{4}t  823 883 1843 2459 2489 (Mela Gangeyabhusani) 2969 3277 (Mela Nitimati) 
p^{5}m^{3}n^{4}s^{4}d^{3}t^{2}  727 1483 (Mela Bhavapriya) 1721 (Mela Vagadhisvari) 1837 2411 2789 3253 (Mela Naganandini) 
p^{5}m^{4}n^{4}s^{4}d^{3}t  695 1465 (Mela Ragavardhani) 1765 1835 2395 2965 3245 (Mela Varunapriya) 
p^{4}m^{4}n^{4}s^{3}d^{4}t^{2}  439 1763 1819 2267 2929 2957 3181 
p^{3}m^{3}n^{6}s^{3}d^{3}t^{3}  877 (Moravian Pistalkova) 1243 1691 1747 (Mela Ramapriya) 2669 (Jeths' mode) 2893 2921 
p^{3}m^{3}n^{6}s^{3}d^{3}t^{3}  731 1627 1739 (Mela Sadvidhamargini) 1753 (Hungarian Major) 2413 (Locrian nr.2) 2861 2917 (Nohkan Flute scale) 
p^{4}m^{4}n^{5}s^{3}d^{3}t^{2}  875 (Locrian Doubleflat 7) 1435 (Makam Huzzam) 1645 (Dorian flat 5) 1715 (Harmonic Minor inverse) 2485 (Harmonic Major) 2765 (Lydian Diminished) 2905 (Aeolian flat 1) 
p^{4}m^{4}n^{4}s^{5}d^{2}t^{2}  1371 (Superlocrian) 1389 (Minor Locrian) 1461 (MajorMinor) 1707 (Mela Natakapriya) 1749 (Acoustic) 2733 (Melodic Minor ascending) 2901 (Lydian Augmented) 
p^{4}m^{4}n^{5}s^{3}d^{3}t^{2}  859 (Ultralocrian) 1459 (Phrygian Dominant) 1643 (Locrian natural 6) 1741 (Altered Dorian) 2477 (Harmonic Minor) 2777 (Aeolian Harmonic) 2869 (Ionian Augmented) 
p^{6}m^{3}n^{4}s^{5}d^{2}t  1387 (Locrian) 1451 (Phrygian) 1453 (Aeolian) 1709 (Dorian) 1717 (Mixolydian) 2741 (Major) 2773 (Lydian) 
Modal families with 8 tones
p^{4}m^{5}n^{5}s^{6}d^{6}t^{2}  509 1151 2623 3359 3727 3911 4003 4049 
p^{4}m^{5}n^{6}s^{5}d^{6}t^{2}  639 1017 2367 3231 3663 3879 3987 4041 
p^{4}m^{5}n^{5}s^{6}d^{6}t^{2}  383 2033 2239 3167 3631 3863 3979 4037 
p^{5}m^{5}n^{5}s^{5}d^{6}t^{2}  507 1599 2301 2847 3471 3783 3939 4017 
p^{5}m^{5}n^{5}s^{6}d^{5}t^{2}  1013 1277 1343 2719 3407 3751 3923 4009 
p^{5}m^{4}n^{6}s^{6}d^{5}t^{2}  765 1215 2025 2655 3375 3735 3915 4005 
p^{5}m^{6}n^{5}s^{4}d^{6}t^{2}  831 1011 2463 2553 3279 3687 3891 3993 
p^{5}m^{5}n^{5}s^{6}d^{5}t^{2}  703 1529 2021 2399 3247 3671 3883 3989 
p^{5}m^{5}n^{5}s^{5}d^{6}t^{2}  447 2019 2271 3057 3183 3639 3867 3981 
p^{5}m^{5}n^{4}s^{5}d^{6}t^{3}  503 1823 2299 2959 3197 3527 3811 3953 
p^{5}m^{4}n^{6}s^{5}d^{5}t^{3}  1005 1275 1695 2685 2895 3495 3795 3945 
p^{4}m^{5}n^{6}s^{5}d^{5}t^{3}  763 1631 2009 2429 2863 3479 3787 3941 
p^{5}m^{5}n^{5}s^{5}d^{5}t^{3}  1003 1439 1661 2549 2767 3431 3763 3929 
p^{4}m^{6}n^{4}s^{7}d^{4}t^{3}  1375 1405 1525 2005 2735 3415 3755 3925 
p^{4}m^{5}n^{6}s^{5}d^{5}t^{3}  893 1247 2003 2671 3049 3383 3739 3917 
p^{6}m^{5}n^{4}s^{4}d^{6}t^{3}  927 999 2511 2547 (Raga Ramkali) 3303 3321 3699 3897 
p^{5}m^{5}n^{5}s^{5}d^{5}t^{3}  863 1523 1997 (Raga Cintamani) 2479 2809 3287 3691 3893 
p^{5}m^{4}n^{6}s^{5}d^{5}t^{3}  735 1785 1995 2415 3045 3255 3675 3885 
p^{5}m^{5}n^{4}s^{5}d^{6}t^{3}  479 1991 2287 3043 3191 3569 3643 3869 
p^{6}m^{4}n^{4}s^{5}d^{6}t^{3}  495 1935 2295 3015 3195 3555 3645 3825 
p^{5}m^{5}n^{5}s^{5}d^{5}t^{3}  989 1271 1871 2683 2983 3389 3539 3817 
p^{6}m^{5}n^{5}s^{5}d^{5}t^{2}  759 1839 1977 2427 2967 3261 3531 (Neveseri) 3813 
p^{5}m^{5}n^{6}s^{4}d^{5}t^{3}  987 1659 (Maqam Shadd'araban) 1743 2541 (Algerian) 2877 2919 3507 (Maqam Hijaz) 3801 
p^{6}m^{5}n^{5}s^{6}d^{4}t^{2}  1403 (Espla's scale) 1517 1711 (Adonai Malakh) 1973 2749 2903 3499 (Hamel) 3797 
p^{5}m^{6}n^{6}s^{4}d^{5}t^{2}  891 1647 1971 2493 2871 3033 3483 3789 
p^{6}m^{5}n^{4}s^{5}d^{5}t^{3}  983 1487 1853 2539 (Halfdiminished Bebop) 2791 3317 3443 (Verdi's Scala enigmatica) 3769 
p^{7}m^{4}n^{5}s^{6}d^{4}t^{2}  1455 (Phrygian/Aeolian mixed) 1515 (Phrygian/Locrian mixed) 1725 (Minor Bebop) 1965 (Raga Mukhari) 2775 2805 (Ishikotsucho) 3435 (Prokofiev) 3765 (Dominant Bebop) 
p^{6}m^{5}n^{5}s^{6}d^{4}t^{2}  1391 1469 1781 1963 2743 3029 3419 (Magan Abot) 3757 (Raga Mian Ki Malhar) 
p^{6}m^{5}n^{5}s^{5}d^{5}t^{2}  957 1263 1959 2679 3027 3387 3561 3741 
p^{6}m^{4}n^{4}s^{4}d^{6}t^{4}  975 (Messiaen mode 4) 2535 (Messiaen mode 4) 3315 (Tcherepnin Octatonic mode 1) 3705 (Messiaen mode 4 inverse) 
p^{6}m^{5}n^{4}s^{5}d^{5}t^{3}  943 1511 1949 2519 2803 (Raga Bhatiyar) 3307 3449 3701 
p^{5}m^{5}n^{6}s^{4}d^{5}t^{3}  879 1779 1947 2487 2937 3021 3291 3693 
p^{5}m^{5}n^{5}s^{5}d^{5}t^{3}  751 1913 1943 2423 3019 3259 3557 3677 
p^{5}m^{7}n^{5}s^{4}d^{5}t^{2}  955 1655 1895 2525 2875 2995 (Raga Saurashtra) 3485 (Sabach) 3545 
p^{4}m^{7}n^{4}s^{6}d^{4}t^{3}  1399 1501 1879 1909 2747 2987 3421 3541 
p^{5}m^{7}n^{5}s^{4}d^{5}t^{2}  887 1847 1907 2491 2971 3001 3293 3533 
p^{6}m^{6}n^{5}s^{4}d^{5}t^{2}  951 1767 1851 2523 2931 2973 3309 3513 
p^{5}m^{5}n^{6}s^{5}d^{4}t^{3}  1499 (Bebop Locrian) 1723 (JG Octatonic) 1751 1901 2797 2909 2923 3509 
p^{6}m^{5}n^{6}s^{5}d^{4}t^{2}  1467 (Spanish Phrygian) 1719 1773 (Blues scale II) 1899 2781 2907 (Magen Abot) 2997 (Major Bebop) 3501 (Maqam Nahawand) 
p^{4}m^{6}n^{4}s^{6}d^{4}t^{4}  1495 (Messiaen mode 6) 1885 2795 (Van der Horst Octatonic) 3445 (Messiaen mode 6 inverse) 
p^{5}m^{5}n^{6}s^{5}d^{4}t^{3}  1463 1757 1771 1883 2779 (Shostakovich) 2933 2989 (Bebop Minor) 3437 
p^{4}m^{4}n^{8}s^{4}d^{4}t^{4}  1755 (Octatonic) 2925 (Diminished) 
Modal families with 9 tones
p^{6}m^{6}n^{6}s^{7}d^{8}t^{3}  511 2303 3199 3647 3871 3983 4039 4067 4081 
p^{6}m^{6}n^{7}s^{7}d^{7}t^{3}  1021 1279 2687 3391 3743 3919 4007 4051 4073 
p^{6}m^{6}n^{7}s^{7}d^{7}t^{3}  767 2041 2431 3263 3679 3887 3991 4043 4069 
p^{6}m^{7}n^{7}s^{6}d^{7}t^{3}  1019 1663 2557 2879 3487 3791 3943 4019 4057 
p^{6}m^{7}n^{6}s^{8}d^{6}t^{3}  1407 1533 2037 2751 3423 3759 3927 4011 4053 
p^{6}m^{7}n^{7}s^{6}d^{7}t^{3}  895 2035 2495 3065 3295 3695 3895 3995 4045 
p^{7}m^{7}n^{6}s^{6}d^{7}t^{3}  1015 1855 2555 2975 3325 3535 3815 3955 4025 
p^{7}m^{6}n^{7}s^{7}d^{6}t^{3}  1531 1727 2029 (Kiourdi) 2813 2911 3503 3799 3947 4021 (Raga Pahadi) 
p^{7}m^{6}n^{7}s^{7}d^{6}t^{3}  1471 1789 (Blues Enneatonic II) 2027 2783 3061 3439 3767 (Chromatic Bebop) 3931 4013 (Raga Pilu) 
p^{7}m^{7}n^{6}s^{6}d^{7}t^{3}  959 2023 2527 3059 3311 3577 3703 3899 3997 
p^{7}m^{6}n^{6}s^{6}d^{7}t^{4}  1007 1951 2551 3023 3323 3559 3709 3827 3961 
p^{6}m^{7}n^{6}s^{7}d^{6}t^{4}  1527 1887 2013 2811 2991 3453 3543 3819 3957 
p^{6}m^{6}n^{8}s^{6}d^{6}t^{4}  1759 1787 2011 2927 2941 3053 3511 3803 3949 
p^{6}m^{7}n^{6}s^{7}d^{6}t^{4}  1503 1917 2007 2799 3051 3447 3573 3771 3933 
p^{7}m^{6}n^{6}s^{6}d^{7}t^{4}  991 1999 2543 3047 3319 3571 3707 3833 3901 
p^{8}m^{6}n^{6}s^{7}d^{6}t^{3}  1519 (Locrian/Aeolian mixed) 1967 (Diatonic Dorian mixed) 1981 (Houseini) 2807 3031 3451 3563 3773 (Raga Malgunji) 3829 (Taishikicho) 
p^{7}m^{7}n^{7}s^{6}d^{6}t^{3}  1783 (Youlan scale) 1903 1979 2939 2999 3037 (nine tone scale) 3517 3547 3821 
p^{7}m^{7}n^{7}s^{6}d^{6}t^{3}  1775 1915 1975 2935 3005 3035 3515 (Moorish Phrygian) 3565 3805 
p^{6}m^{9}n^{6}s^{6}d^{6}t^{3}  1911 (Messiaen mode 3) 3003 (Genus Chromaticum) 3549 (Messiaen mode 3 inverse) 
Modal families with 10 tones
p^{8}m^{8}n^{8}s^{8}d^{9}t^{4}  1023 2559 3327 3711 3903 3999 4047 4071 4083 4089 
p^{8}m^{8}n^{8}s^{9}d^{8}t^{4}  1535 2045 2815 3455 3775 3935 4015 4055 4075 4085 
p^{8}m^{8}n^{9}s^{8}d^{8}t^{4}  1791 2043 (Maqam Tarzanuyn) 2943 3069 (Maqam Shawq Afza) 3519 (Raga SindhiBhairavi) 3807 3951 4023 4059 4077 
p^{8}m^{9}n^{8}s^{8}d^{8}t^{4}  1919 2039 3007 3067 3551 3581 3823 3959 4027 4061 
p^{9}m^{8}n^{8}s^{8}d^{8}t^{4}  1983 2031 3039 3063 3567 3579 3831 3837 (Minor Pentatonic with leading tones) 3963 4029 (Major/Minor mixed) 
p^{8}m^{8}n^{8}s^{8}d^{8}t^{5}  2015 (Messiaen mode 7) 3055 (Messiaen mode 7) 3575 (Symmetrical Decatonic) 3835 3965 (Messiaen mode 7 inverse) 
Modal families with 11 tones
p^{10}m^{10}n^{10}s^{10}d^{10}t^{5}  2047 3071 3583 3839 3967 4031 4063 4079 4087 4091 4093 
Modal families with 12 tones
p^{12}m^{12}n^{12}s^{12}d^{12}t^{6}  4095 (Chromatic) 
Proximity
We would consider two scales to be "near" each other, if they bear many similarities; sharing many of the same notes, such that it would take few mutations to turn one into the other.
This distance measured by mutation is almost the same thing as a "Levenshtein Distance". The normal definition of a Levenshtein Distance on a string of characters allows three kinds of mutation: insertion, deletion, and substitution. Our scale mutations are different from a string mutation, in that scales can't do substitution, instead we move tones up or down with rules for handling collision. This difference means we can't employ all the elegant formulas bequeathed to us by Vladimir Levenshtein.
We can mutate a scale in three ways:
 Move a tone up or down by a semitone
 Remove a tone
 Add a tone
It is simple to generate all the scales at a distance of 1, just by performing all possible mutations to every interval above the root.
function findNearby($scale) {
$near = array();
for ($i=1; $i<12; $i++) {
if ($scale & (1 << ($i))) {
$copy = $scale;
$off = $copy ^ 1 << ($i);
$near[] = $off;
$copy = $off  1 << ($i  1);
$near[] = $copy;
if ($i != 11) {
$copy = $off  1 << ($i + 1);
$near[] = $copy;
}
} else {
$copy = $scale;
$copy = $copy  1 << ($i);
$near[] = $copy;
}
}
return $near;
}
Example
Here are all the scales that are a distance of 1 from the major scale, aka 2741 , shown here as a simple C major scale:
add a tone at C#  2743  
lower the D to D♭  2739 (Mela Suryakanta)  
raise the D to D#  2745 (Mela Sulini)  
delete the D  2737 (Raga Hari Nata)  
add a tone at D#  2749  
lower the E to E♭  2733 (Melodic Minor ascending)  
same as deleting E  
delete the E  2725 (Raga Nagagandhari)  
same as deleting F  
raise the F to F#  2773 (Lydian)  
delete the F  2709 (Raga Kumud)  
add a tone at F#  2805 (Ishikotsucho)  
lower the G to G♭  2677  
raise the G to G#  2869 (Ionian Augmented)  
delete the G  2613 (Raga Hamsa Vinodini)  
add a tone at G#  2997 (Major Bebop)  
lower the A to A♭  2485 (Harmonic Major)  
raise the A to A#  3253 (Mela Naganandini)  
delete the A  2229 (Raga Nalinakanti)  
add a tone at A#  3765 (Dominant Bebop)  
lower the B to B♭  1717 (Mixolydian)  
same as deleting B  
delete the B  693 (Arezzo Major Diatonic Hexachord) 
Evidently since every scale will have a collection of neighbours similar to this one, a complete graph of scale proximity is large, but not unfathomably so.
We can also easily calculate the Levenshtein distance between two scales. Apply an XOR operation to expose changed bits between two scales. Adjacent on bits in the XOR where the bits were different in the original scale identify a "move" operation. Any bits remaining are either an addition or deletion.
function levenshtein_scale($scale1, $scale2) {
$distance = 0;
$d = $scale1 ^ $scale2;
for ($i=0; $i<12; $i++) {
if (
($d & (1 << ($i))) && ($d &(1 << ($i+1)))
&&
($scale1 & (1 << ($i))) != ($scale1 & (1 << ($i+1)))
) {
$distance++;
$d = $d & ( ~ (1 << ($i)));
$d = $d & ( ~ (1 << ($i+1)));
}
}
for ($i=0; $i<12; $i++) {
if (($d & (1 << ($i)))) {
$distance++;
}
}
return $distance;
}
Imperfection
Imperfection is a concept invented (so far as I can tell) by William Zeitler, to describe the presence or absense of perfect fifths in the scale tones. Any tone in the scale that does not have the perfect fifth above it represented in the scale is an "imperfect" tone. The number of imperfections is a metric that plausibly correlates with the perception of dissonance in a sonority.
The only scale that has no imperfections is the 12tone chromatic scale.
This table differs from Zeitler's^{8}, because this script does not deduplicate modes. If an imperfection exists in a scale, it will also exist in all the sibling modes of that scale. Hence the single imperfect tone in the 11tone scale is found 11 times (in 11 scales that are all modally related), whereas Zeitler only counts it as one.
number of notes in scale  # of Imperfections  

0  1  2  3  4  5  6  
1  0  0  0  0  0  0  0  
2  0  0  0  0  0  0  0  
3  0  0  0  1  0  0  0  
4  0  0  8  16  7  0  0  
5  0  5  30  75  40  5  0  
6  0  6  69  146  102  12  1  
7  0  7  84  196  112  14  0  
8  0  8  84  168  62  0  0  
9  0  9  72  84  0  0  0  
10  0  10  45  0  0  0  0  
11  0  11  0  0  0  0  0  
12  1  0  0  0  0  0  0 
Going Further
 Looking at the table, there are 5 scales of 5 tones with one imperfection. There are 6 scales of 6 tones with only one imperfection. The same patten continues right up to 11 tones. What causes this pattern?
 The only 7note scale with only one imperfection is the major diatonic scale (plus all its modes). Is it a coincidence that we find this scale sonically pleasing?
Negative
One peculiar way we can manipulate a scale is to "flip its bits"  so that every bit that is on becomes off, and all that were of are turned on. If you flip a scale with a root tone, you will get a nonscale without a root tone; so it's not so useful to speak of negating a scale, instead we negate an entire modal family to find the modal family that is its negative.
For example, one that's easy to conceptualize is the major scale, which (in C) occupies all the white keys on a piano. The negative of the major scale is all the notes that aren't in the major scale  just the black keys, which interestingly have the pattern of a major pentatonic (with F# as the root). In pitch class set theory, the negative of a set is called its "complement", and Dr Forte named complementary pairs with matching numbers.
Chord Relationships
In the case of heptatonic chords, we can use the stackedthird members of a scale to create a chord. More on this later.
Glossary
 TET
 Twelvetone Equal Temperament. The system in which our octave is split into twelve equal intervals.
 achiral
 Not having chirality, i.e. the mirror image can be achieved by rotation.
 ancohemitonic
 A scale that is not cohemitonic. This either means it contain no semitones (and thus is anhemitonic), or contain semitones (being hemitonic) where none of the semitones appear consecutively in scale order.
 anhemitonic
 A scale that does not include any semitones
 atritonic
 Containing no tritones
 balance
 Having tones distributed such that if they were equal weights distributed on a spokes of a 12spoke wheel, the wheel would balance on its centre.
 chiral
 The quality of being different from ones own mirrorimage, in a way that can not be achieved by rotation.
 cohemitonic
 Cohemitonic scales contain two or more semitones (making them hemitonic) such that two or more of the semitones appear consecutively in scale order. Example: the Hungarian minor scale
 coherence
 An unabiguous relationship between specific intervals and generic intervals. Also known as propriety.
 dicohemitonic
 A scale that contains exactly two semitones consecutively in scale order
 dihemitonic
 A scale that contains exactly two semitones
 distribution spectra
 The collection of the spectrum of distribution of specific intervals for each generic interval of a scale
 enantiomorph
 The result of a transformation by reflection, i.e. with its interval pattern reversed
 generic interval
 The number of scale steps between two tones
 heliotonic
 A scale which can be rendered with one notehead on each line and space, using nothing more than single or double alterations
 hemitonic
 A scale that includes semitones
 hepatonic
 A scale with seven tones. For example, the major scale is heptatonic.
 imperfection
 A scale member where the perfect fifth above it is not in the scale
 interval of equivalence
 The interval at which the pitch class is considered equivalent. In TET, the interval of equivalence is 12, aka an octave.
 interval pattern
 The sequence of semitones, tones, and larger intervals, that describe a scale. For example, a major scale is "T T S T T T S". Expressed numerically, a major scale has the interval pattern [2,2,1,2,2,2]; the final interval is implied.
 interval spectrum
 A signature invented by Howard Hanson, describing all the intervals that can be found in a sonority
 mutation
 The alteration of a scale by addition or removal of a tone, or by shifting a tone up or down by a semitone.
 octatonic
 A scale with eight tones.
 palindromic
 A scale that has the same interval pattern forward and backward.
 pentatonic
 A scale with five tones
 propriety
 An unabiguous relationship between specific intervals and generic intervals. Also known as coherence.
 proximity
 The number of transformations required to change one scale into another
 root
 The lowest tone of the scale, signifying the tone upon which all others are measured as an interval above
 scale
 A set of tones starting on a root, contained within one octave, having no more than a major third leap
 sonority
 The whole of a sound, comprised of all component tones
 specific interval
 The number of semitones between two tones
 spectra variation
 The average of the spectra widths with respect to the number of tones in a scale
 spectrum width
 The difference between the lowest and highest specific intervals for a given generic interval
 symmetry
 Having the ability to transform into itself by reflection or rotation
 tone
 A single entity having a pitch, as in one member of a scale
 trihemitonic
 A scale that contains exactly three semitones
 tritonic
 Containing one or more tritones
 truncation
 A scale produced by removing tones from another scale
 unhemitonic
 A scale that contains only one semitone
Acknowledgements
This exploration of scales owes a great debt to William Zeitler^{9}. Some of the concepts and charts reiterate Zeitler's findings, presented here along with additional observations. This exploration also owes a debt to Andrew Duncan's work on combinatorial music theory^{10}. Most of the code in this treatise is the result of continuous exploration and development of PHPMusicTools, an opensource project at GitHub.
Citations
1  http://allthescales.org/
2  Howard Hansen, "Harmonic Materials Of Modern Music", ISBN 9780891972075
3  Paul Nelson, "Pitch Class Sets" http://composertools.com/Theory/PCSets.pdf
4  Circular Distributions and Spectra Variations in Music. http://archive.bridgesmathart.org/2005/bridges2005255.pdf
5  Rothernberg Propriety https://en.wikipedia.org/wiki/Rothenberg_propriety
6  Allan Forte, The Structure of Atonal Music (1973, ISBN 0300021208).
7  "The Integer Model Of Pitch", Basic Atonal Theory, John Rahn p.35 ISBN 0028731603
8  Zeitler, William, table of imperfections counted in scales. https://allthescales.org/intro.html#Perfection
9  William Zeitler, "All The Scales", http://allthescales.org
10  Andrew Duncan, "Combinatorial Music Theory", Journal of the Audio Engineering Society, vol. 39, pp. 427448. (1991 June), retrieved from http://andrewduncan.net/cmt/
This scale analysis was created by Ian Ring, Canadian Composer of works for Piano, and total music theory nerd. The software used to generate this analysis is an open source project at GitHub. Scale notation generated by VexFlow, and MIDI playback by MIDI.js
Cached 20190523 12:09:57