You have 1000 numbers between 0-15 (4-bits). So that is 4000 bits of information. And you want to compress that to an unsigned integer. Unless your system allows you to use 500 bytes for unsigned integers, there is no way to do it!
If you are allowed to use 500 bytes, then you could pack it with two 4-bit nibbles per byte. Otherwise it isn't possible without losing information.
Let's say it was possible to get your information encoded into a single unsigned integer (e.g. 32 bits)... that one integer would have to represent any possible input of 4000 bits... do you see how there aren't enough bits to represent all the possible combinations of 4000 bits?
The only other way would be if you were allowed to use a very, very large look-up dictionary of some sort, or if you knew some information about the pattern of numbers. For example, if you didn't need to know the exact order of numbers and just needed a count of each digit 0-15, then you could compress more.
But with just a raw sequence of 1000 numbers, there is no way to get it down to a single unsigned integer (unless that int is really big).
However, assuming that you did have a 500 byte unsigned integer... you would just do the following:
1) Set the number = 0
2) Multiply the number by 16:
3) Add the next number in the set:
4) While you still have input, go to step 2.