For example, you could say
$y = f(i,j)$ for integers $1 \leq i,j \leq n$ with $i \neq j$
or (which is what I would use)
$y = f(i,j)$ for distinct $i,j \in \{1,\dotsc,n\}$
Note that if you are not defining $y$ for every viable pair $(i,j)$, you should add some after for.
Since you seem worried that you can put text only in inline formulas, the following is LaTeX code would insert my second example as a displayed formula
\[
y = f(i,j) \quad \text{for distinct } i,j \in \{1,\dotsc,n\}
\]
or you could always write the additional condition right after the formula
\[
y = f(i,j)
\]
for distinct $i,j \in \{1,\dotsc,n\}$
Note: Even if you could write this only in symbols, you should avoid it, especially if you're writing for publication. Professional mathematicians don't write with too many symbols because that would make the text look garbled and hard to understand.