program lcms
  implicit none
  integer(8), parameter :: md = 998244353_8
  integer :: n, i, j
  integer(8) :: a(200000) = 0_8, s = 0_8, ans = 0_8, tmp
  read(*,*) n
  read(*,*) a(1:n)
  do i = 1, n
    do j = 1, n
      ans = mod(ans+lcm(a(i),a(j)),md)
    end do
  end do
  do i = 1, n
    ans = modulo(ans-a(i),md)
  end do
  write(*,'(i0)') mod(ans*inv(2_8),md)
contains
  integer(8) function lcm(a,b)
    integer(8), intent(in) :: a, b
    lcm = abs(a)/gcd(a,b)*abs(b)
  end
  integer(8) function gcd(a,b)
    integer(8), intent(in) :: a, b
    integer(8) :: x, y
    x = max(abs(a),abs(b))
    y = min(abs(a),abs(b))
    do while (y > 0_8)
      gcd = y
      y = mod(x,y)
      x = gcd
    end do
  end
  integer(8) function inv(n)
    integer(8), intent(in) :: n
    integer(8) :: a, b, c, t, q
    a = modulo(n,md)
    b = md
    c = 0_8
    inv = 1_8
    do while (b /= 0_8)
      q = a/b
      t = b
      b = mod(a,b)
      a = t
      t = inv
      inv = c
      c = t-q*c
    end do
    inv = modulo(inv,md)
  end
end program lcms