Function Divisor

code:

Formula: https://www.mathsisfun.com/definitions/divisor.html

This formula link will help you to think about the logic.

Got this problem from 101cproblems.com