The easiest way to identify sixths and sevenths is to invert the interval and analyze the resulting third or second.
For example, instead of counting the number of whole and half steps in the sixth F#-D#, you can invert the interval and analyze the resulting third. Since the third D#-F# is a minor third, the sixth F#-D# is a major sixth. See Inversion of Intervals for more information on how intervals are transformed after inversion.
The interval E-Db is a diminished seventh, since after the inversion it becomes an augmented second:
See Intervals in the Tutorials section.