Find every equation of the line that passes through the point $(5,13)$ "Find every equation of the line that passes through the point $(5,13)$ and  passes both axis at non-negative, whole values."
Here's my attempt:
Finding first two equations, with $k=\pm1$ is fairly simple. After that, plugging in the $x=5$ and $y=13$ in the equation yields $b=13-5k$. Since the line passes the $y$ axis at $(0,b)$, $b$ has to be whole. That means $13-5k$ has to be whole, $\implies 5k \in Z$.
Only non-negative value of $k$ that passes through the $x$ axis at non-negative value is $k=1$, so for every other line $k<0$. For lines with $k<0$, $b>13$ and value of $x >=6$. $$kx+b=0$$ $$x=\frac{-b}{k}$$ $$\frac{5k-13}{k} \geq 6 $$ $$ k \leq -13 \implies b\leq 78$$
I'm not sure how to proceed from here on, I could just check for each value of $b \in (13,78]$ but that doesn't seem very efficient.
What am I missing? Is my way of doing this correct? Or is there a better way? And if my attempt is correct, how do I proceed?
 A: $$y-13= m(x-5)$$
We can't have $m=0$ or there is no $x$-intercept.
has $x$-intercept $-\frac{13}m+5$ and $y$-intercept $13-5m$.
We require $-\frac{13}m+5 \ge 0$ and $13-5m \ge 0$.
$$m(-13 +5m) \ge 0 \land  m \le \frac{13}5 $$
$$m=\frac{13}{5} \lor  m \le 0$$
Notice that $m$ can't be irrational and it can't be zero.
Suppose $m= \frac{p}{q}, \gcd(p,q)=1$, we need $p$ to divide $13$ and $q$ to divide $5$.
Hence $p\in \{-13, -1, 1, 13\}$ and $q \in \{-5,-1,1,5\}$.
Hence possible values of $m$ are $\frac{13}5, -13,  \frac{-13}5, -1, \frac{-1}5$.

A: Let equation of line be $y = mx + c$, then $c \geq 0$ (the $y$-intercept).
$x$-intercept is when $y = 0$, i.e. $x = \dfrac{-c}{m} \geq 0$ and a whole number, so $m < 0$ and let $c = km$ where $k$ is a negative whole number.
Line passes through $(5, 13)$, so $13 = 5m + c$ i.e. $m = \dfrac{13 - c}{5} =\dfrac{13 - km}{5}$
$\implies(k + 5)m = 13$, where $k$ is a whole number, $k < 0$ and $m < 0$ and $km$ is a positive integer. Also, $5m$ is an integer as $km + 5m = 13$
A: A few things to note:  If $b$ is the $y$ intercept of line and $c$ is the $x$ intercept then the line goes through $(0,b), (c,0)$ and the slope is $m =-\frac bc$.  As $b,c$ are positive the slope is negative.
Point $(5,13),(0,b),(c,0)$ is on the line and the line has a negative slope. So $\frac {13-b}5 =\frac {13}{c-5} < 0$. Therefore $b > 13$. $c > 5$. $b=18\iff c=18$.  And $b< 18\implies c >18$ and $b>18\implies c<18$.
So we just need to test $b=14..17$ and $c >18$.  And $c=6....17$ and $b > 18$.  And $b = c =18$.
The equation for a line is $y=mx + b = m(x-c)$.
And as $(5,13)$ is on the line $13 = -5\frac bc  + b= -\frac bc(5-c)$
Which tells us that $c=\frac {5b}{b-13}$ and that $b=\frac {13c}{c-5}$
Case 1:  $b=c=18$ then $m = -1$ then $13 = -5+b$ and $13=-(5-c)$ so $b=c =18$ and the equation is $y=-x + 18$
Case 2:  $13 < b < 18$ and $c > 18$.  But $c =\frac {5b}{b-13}$ is a positive number and plugging in $b=14...17$ we have $b-13=1...4$ so relatively prime to $5$ so we $b-13|b$ and $1|14$ and $2\not \mid 15$ and $3\not|16$ but $4\not \mid 17$ so the only such equation is $b=14$ and $c = 5*14= 70$ and $y=-\frac 15x + 14$
Case 3:  $b > 18$ and $5 < c < 18$  But we have $b=\frac {13c}{c-5}$ so we have $c-5 = 1....12$ dividing in $13c$ so $c-5|c$ and we have $1|6$ and $5|10$
so we we have $c=6;b=6*13=78$ and so $y =-13x + 78$ or $c=10; b=26$ and $y =-\frac {13}5x + 26$
