I have try to resolve this problem but if I have any mistake pls tell me...
can anyone explain something about ( k ) what does it need to be

Problem description:
POLYALPHABETIC SUBSTITUTION CIPHERS
As one can readily see, monoalphabetic substitution ciphers are notoriously easy to break.
In the case of the Caesar cipher, the shift value can be uncovered rather easily. One way clas-
sical cryptographers dealt with this was to use different shift values for letters depending on
their position in the text. For example, one may do something like the following:
• Let a1, a2, . . . , an be the letters in a plaintext message. Consider the letter ap:
• If p is divisible by 4, shift ap 7 letters down the alphabet.
• If p is of the form 4k + 1 for some k, shift ap 5 letters down the alphabet.
• If p is of the form 4k + 2 for some k, shift ap 13 letters down the alphabet.
• If p is of the form 4k + 3 for some k, shift ap 2 letters down the alphabet.