      program fib
      implicit none
      integer*8 jj, nn, nextra, fstart, flast, ff, ftmp
      write (*,*) '\n\tFibonacci Numbers'
      write (*,*) '\t================='
      write (*,1111) 
 1111 format ('\nEnter the initial Fibonacci number: ',$)
      read  (*,*) fstart
      write (*,2222) 
 2222 format ('How many additional Fibonacci numbers do you want? ',$)
      read  (*,*) nextra
      if (fstart .le. 1) stop
      nn = nextra + 1
      write (*,*) '\n',nn,' Fibonacci numbers starting with ',fstart,':'
      flast = 1
      ff = 1
      nn = 100
      do jj=2,100
         ftmp = ff
         ff = ff + flast
         flast = ftmp
         if ((ff .gt. fstart) .and. (nn .ge. 100)) then
            write (*,*) ' '
            write (*,*) 'Ahem! ', fstart, ' is not a Fibonacci number!'
            write (*,*) ' '
            exit
         else if (ff .eq. fstart) then
            nn = -1
         end if
         nn = nn + 1
         if (nn .lt. 100) then
            if (nn .gt. nextra) then
               write (*,*) ' '
               stop
            end if
            write (*,*) '  #', jj, ':	', ff
         end if
      end do
      stop
      end
