A major scale is a sequence of notes x_{1},x_{2},x_{3},x_{4},x_{5},x_{6},x_{7},x_{8} such that

_{2}is 2 semitones higher than x

_{1}

_{3}is 2 semitones higher than x

_{2}

_{4}is 1 semitone higher than x

_{3}

_{5}is 2 semitones higher than x

_{4}

_{6}is 2 semitones higher than x

_{5}

_{7}is 2 semitones higher than x

_{6}

_{8}is 1 semitone higher than x

_{7}

Alternatively, treating notes as integers, (x_{1},x_{2},x_{3},x_{4},x_{5},x_{6},x_{7},x_{8}) is a major scale iff
(x_{1},x_{2},x_{3},x_{4},x_{5},x_{6},x_{7},x_{8})=(x_{1},x_{1}+2,x_{1}+4,x_{1}+5,x_{1}+7,x_{1}+9,x_{1}+11,x_{1}+12).