There are a number of approaches. Assuming you are looking for a purely primitive-based on, then something like
\ifnum\ifnum\x=1 1\else\ifnum\x=14 1\else0\fi\fi
Thus you use 'secondary' conditionals to convert the original problem into a simple TRUE/FALSE situation, where the 'outer'
\ifnum is simply testing for
1. (This works as TeX keeps expanding until it finds a number when considering the outer
It's important to get the number-termination correct when using this approach. In the example, the spaces after
\x=14 are required to get the correct outcome. With a bit more imagination, you can make more complex constructs using the same approach (for example, you can having combined OR and AND conditions in this way.)
An alternative method if the logic gets complex would be to include the 'payload' as separate macros:
This is what you often see with larger 'to do' blocks. The
\expandafter use is 'good practice' but may not be needed depending on the exact nature of the code to insert.