4240 FOR K=KM TO KN