Function to calculate entropy of sequence of following characters