      SUBROUTINE FACTR (N,IFACT,NFACT)
C     FACTOR N INTO ITS PRIME FACTORS, NFACT IN NUMBER.  FOR EXAMPLE, 
C     FOR N = 1960, NFACT = 6 AND IFACT(IF) = 2, 2, 2, 5, 7 AND 7.
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)
      DIMENSION IFACT(1)
      IF=0
      NPART=N 
      DO 50 ID=1,N,2
      IDIV=ID 
      IF (ID-1) 10,10,20
 10   IDIV=2
 20   IQUOT=NPART/IDIV
      IF (NPART-IDIV*IQUOT) 40,30,40
 30   IF=IF+1 
      IFACT(IF)=IDIV
      NPART=IQUOT 
      GO TO 20
 40   IF (IQUOT-IDIV) 60,60,50
 50   CONTINUE
 60   IF (NPART-1) 80,80,70 
 70   IF=IF+1 
      IFACT(IF)=NPART 
 80   NFACT=IF
      RETURN
      END 
