# Too Many Numbers

1. Sep 13, 2004

### Hypercase

How do i compress 24 numbers to something like 1 to 6 numbers.
For example consider these numbers:-
134217736
14336
16515072
-33554425
768
229376
25165825
-1073741376
16834306
16776192
-1048449
-268402704
16775169
-1336671440
1141059650
53494531
809567024
1090728001

Please help me with an algorithim that will compress these to less than 6 numbers, and that i can reverse the effect of and obtain these number back at a later stage.
Is there any other way that you can think of compressing numbers.
-Cheers.

2. Sep 13, 2004

### gravenewworld

If you work with a different number base other than 10 you will be able to shrink how long the numbers are. For example 100 in base 100 would just be 10. Just try to find a different base that will work for you.

3. Sep 13, 2004

### gazzo

heh, my compsci lecturer was talking about how she did something like that for her masters thesis, involving prime numbers :S, compressing >60 digit numbers

4. Sep 13, 2004

### Gokul43201

Staff Emeritus
Are you trying to reduce the number of digits in each number (the number of numbers remains unchanged), or the total number of numbers (digits of no concern), or do you want to reduce the total number of digits (just reduce memory space...how , doesn't matter) ?

5. Sep 13, 2004

### Hypercase

Im hoping to reduce the number of numbers.
I suppose reducing the number of digits would help too.

-Cheers.

6. Sep 13, 2004

### Gokul43201

Staff Emeritus
Here's an approach that reduces the number of numbers by any amount you desire...but it increases the total number of digits :

append numbers to each other using a specific sequence (key) as a spacer. Choose the key such that it does not already exist among your numbers. For your numbers, say you pick the sequence 1234 (as that does not appear anywhere) as your spacer.

Now you can combine all your numbers into one giant number with several 1234s in it.

So, you'd have : 1342177361234143361234165150721234-3355442512347681234....

Now, if you wish you can switch to a higher base, to reduce the number of digits (though you'll need more types of digits).

Last edited: Sep 13, 2004