Racket 143 bytes
-

    (let((s(number->string n))(g substring))(for/sum((i(range 1(string-length s))))
    (modulo n(apply +(map string->number(list(g s 0 i)(g s i)))))))
    
Ungolfed: 

    (define (f n)
      (let ((s (number->string n))
            (g substring))
        (for/sum ((i (range 1 (string-length s))))
          (modulo n (apply + (map string->number (list (g s 0 i) (g s i))))))))

Testing: 
    
    (f 47852)
    (f 13)
    (f 111)
    (f 12345)
    (f 54321)
    (f 3729105472)

Output: 
    
    5842
    1
    6
    2097
    8331
    505598476