3130 FOR K=KM TO KN