      SUBROUTINE nprime (n, ifact, nfact)
!
! Decomposition en facteurs premier de n
!
!     IMPLICIT NONE
!
! Declaration des arguments
!
! nombre a decomposer
      INTEGER,  INTENT(IN)  ::  n
!
! tableau des diviseurs premiers
      INTEGER,  DIMENSION(1:10),  INTENT(OUT)  ::  ifact
!
! nombre de diviseurs premiers
      INTEGER,  INTENT(OUT)  ::  nfact
!
! Declaration des variables locales
!
      INTEGER  ::  k
      INTEGER  ::  n2
!
      INTEGER,  PARAMETER  ::  ipx = 11
      INTEGER,  DIMENSION (ipx)  ::  iprime = &
      (/ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 /)
!
! Debut de la subroutine
!
      n2 = n
!
      nfact = 0
      ifact(:) = 1
      k = 1
!
      DO WHILE( (n2 /= 1) .AND. (k /= ipx+1 ) )
!
         DO WHILE( MOD( n2, iprime(k) ) == 0 ) 
!
           n2 = n2 / iprime(k)
           nfact = nfact + 1
           ifact(nfact) = iprime(k)
!
         END DO
!
         k = k + 1
!
      END DO
!
      IF ( n2 /= 1 ) THEN
         nfact = nfact + 1
         ifact(nfact) = n2
      END IF
!
! Fin   de la subroutine
!
      RETURN
      END SUBROUTINE nprime

