Position of all the letters of the word MONKEY are 13 15 14 11 05 25
& position of 6 successive letters starting from M are 13 14 15 16 17 18
(Here M is the first letter of word MONKEY)
Modulus of differences of these numbers are 00 01 01 05 12 07
Sum of these differences = 26 hence the code
Similarly for others