I've seen this type of compression before, as I answer questions in a different forum from time to time.
Teebee was so kind to help with the frequency table.
My pari/gp solution:
Code: Select all
{
freq = [8.167, 1.492, 2.782, 4.253, 12.702, 2.228, 2.015, 6.094, 6.966, 0.153, 0.772, 4.025, 2.406, 6.749, 7.507, 1.929, 0.095, 5.987, 6.327, 9.056, 2.758, 0.978, 2.360, 0.150, 1.974, 0.074];
n = 0.8579089046659475886936755259078 * 100;
for(i=1,25,
index = 1;
s = 0;
while(s + freq[index] < n,
s += freq[index];
index += 1);
remaining = freq[index];
n -= s;
n = n / remaining * 100;
printf("%c", 64 + index)
)
}