Hilmar mentions a possibility of transforming the color space into a one-dimensional construct. Indeed, this is possible, but the reason we do not do that is that the way we structure the world has meaning.
Now, to your question:
Is it possible to use one number and have the same or very similar properties when comparing colors as we have for two number color representation.
No. It is impossible to prove a negative with such an open question, but we could employ some considerations. Perceptual ways to model color - say, L*u*v* or even HSL color spaces, - have one important property in common: similar colors are close numerically, while dissimilar are not. Moreover, chromaticities are additive: a linear mixture of two real colors is also a real color, and it is perceptually in between the two original ones. This is a subset of what is known as Grassmann's laws (I actually recommend this read if you're interested in color theory, but, as Cristoph remarks, it is a notorious rabbit hole). This linear mixability and the existence of complementary colors as a corollary (also available at the corresponding Wikipedia page) is key here.
Could this be achieved with just one number? Well, the easiest way to demonstrate the issue is to take two of the primaries (say, blue and red) and consider where the third one would fit on a proposed linear scale. It can't be between them, so it has to be outside. Just like so, we have arrived at hue. So far, so good, but now where do the bleaker versions of the primaries fit in? We could maintain a measure of them being perceptually close like so:

But, crucially, additivity will be lost here no matter what we do: one could always pick two bleak colors and end up with a vibrant one in between.

As per Grassmann's laws, bleak colors should be a linear mixture of complementary colors, and the diagram just above violates that. In fact, they should all be somewhere near the middle: this is the reason white point is in the middle of the chromaticity diagram. Any way of representing both hue and saturation in one dimension would break the color mixability.
The core of the issue is that we perceive "closeness" of colors based on more than one factor. Say (26, 107, 230) is close to BOTH (26, 168, 230) and (13, 104, 242) - do also note how RGB is not so great for representing human perception of color! The first transition is not as much greener as it is lighter, which is something apparent when you look at their HSL representations.
Yet another point to make is the pure technical one. Indeed, we could discretize the color space using the transform of, say, C = 65536*R + 256*G + B.
Now, let's say we have a number - I'll use 5717334 (87, 61, 86 RGB) as an example. What happens when we decide to go from 8 bit color representation to 10 bit color representation, shifting the definition accordingly? It becomes (5, 463, 342 RGB 10-bit), which would correspond to a completely different initial color (1, 116, 86 RGB) - not just substantially darker shade. Using the color space that corresponds to underlying biophysical phenomena makes it less implementation specific, and now you can do all kinds of things - chroma subsampling comes to mind - without worrying too much you would have to re-do everything anew when some small part of it changes. With RGB, going from 8-bit to 10-bit is as simple as multiplying values by 4. If you have a single number, having to transform it back to the original representation and back every time you want to alter an implementation detail is a sign the original implementation made more sense.
In other words, all models are wrong, but some are useful. We could use one number or hundreds of numbers - hyperspectral imaging would be one example - but using 2 or 3 components makes the most sense precisely because we humans are built this way. It is not a fundamental property of the physical nature of light, but it is a fundamental psychophysiological property of human color vision.