There are no illegal numbers. But if you provide context, they can become illegal data. Let's take child pornography for an example, because that's universally accepted as illegal. I could come up with a formula which translates a huge number into a bitmap. I could post the number (i.e. the input for the formula) online, because it is absolutely meaningless to anyone else. But when I publish my formula, it is no longer a number. It's data which can be interpreted as something meaningful, an image.
Everything is just a number without context.