When is a problem specified on a TM contained in non-uniform classes such as P/poly?
If $N$ were written in unary, then the language would be a unary language, i.e., a subset of $\{0,1\}^*$.   Every unary language is in P/poly.  That's because a P/poly machine is allowed a separate advice string, one per length of the input.  The advice string for length $n$ could just describe whether the input $1^n$ should be accepted or not.  Or, to put it another way, P/poly allows you to specify a separate circuit per input length; so you could use the "always output no" circuit for lengths $n$ such that $1^n$ is not part of the language, otherwise the "always output yes" circuit.  See https://en.wikipedia.org/wiki/P/poly.