For example, assume we have number $a = 111$. Clearly, each of the $n = 3$ least significant digits is greater than $0$ so this number is acceptable (return $1$).
However, consider the number $a = 310$. The least significant digit is $0$ so this number is not acceptable (return $0$).
More specifically, I want to express this function in a single math formula using math notations. The ultimate purpose of this is to express it as exactly one constraint in a Linear Programming formulation.
For instance, one approach would be to compare the number to an $n$-digit number composed of 1s. For instance, if $n = 3$, we can compare the number to $111$. This can be trivially expressed as $a < 111$.
However, this doesn't work because $200$ is accepted since it's greater than $111$, but not all digits are greater than $0$.
Constraints for the formula:
- No multiplication of the digits.
- No bitwise operations.
Saying "in base $x$" means that you have the expansion of the number as a string of digits. So you see the zeroes and the question doesn't make much sense.
If the number is available in another base (to make this question meaningful), such as binary, you don't have much more resort than converting to the base $x$.
This involves modulo operations, i.e. worse than what you forbid.
Update, using the newer explanations:
For, say, $n=3$, the "forbidden" numbers are
$$1000k+\{0,1,2,3,\cdots,110,120,130\cdots,200,201,202,\cdots210,220,230\cdots,\cdots990\}.$$
This set would require dozens of inequalities to be represented by linear constraints.