So I found out that using these two equations:
x*y=n
sin(x*pi)=sin(n*pi/x)=0
a list of factors to n could be found.
currently, the best single function that finds all integer factors is $$ \left|\cos\left(x\pi\right)\right|+\left|\cos\left(\frac{n\pi}{x}\right)\right|=2 $$
this is the best I could find. My question is, is this a reliable way to find factors for n, and if not, what are some better ways?
Both formulas base on a simple property of the sine- and the cosine-function. $$\sin{\pi x}=0$$ holds if and only if $x$ is an integer and $$|\cos{\pi x}|=1$$ holds if and only if $x$ is an integer. So, the method actually works for all $n$.