# Puzzles/Compress

## Problem

Compress the decimal representation of a natural number to an expression in J with less characters than the number of digits.
E.g. 120 can be compressed to  !5 .

### Constraints

• The expression(s) in J should produce the number for anyone in a new session in a freshly installed J-version with the maximal printing precision:  (9!:11) 20 .
• The total number of characters needed (in a new session in a freshly installed J-version) should be less than the number of digits in the decimal representation of the number.

### Credits

This puzzle was inspired by a solution given by Raul Miller in Jforum where he gave an excellent example of compression. See example.

### Rules

0. The rate of compression is the ratio between the number of (decimal) digits and the number of characters in the expression. 1. Since the compression ratio is unbounded, the smaller the number the better. 2. Higher (rate of) compression per number is better.

### Remarks

•  %~&(#@":)". can be used to determine the compression (rate) of an expression.
```   (%~&(#@":)".)'!5'
1.5
```
• Numbers which are not compressable are "Kolmogorov random", see Kolmogorov
• Proliferation of modern programming languages:
"APL: You shoot yourself in the foot, then spend all day figuring out how to do it in fewer characters."

## Solutions

 Number Sentence Compression Notes Author 120 !5 1.5 Trivial, since  !y needs less characters for all  y>4 . Smallest number (I know of) which can be compressed RE Boss 1024 4^5 1.33 Trivial, since most of  x^y are compressed. x = 2 3 4 5 6 7 8 9 10 y>: 14 7 5 5 4 4 4 4 4 RE Boss 9534410355667921512188400 *./33+i.29x 2.27 Smallest number which is divisible by all numbers 1,...,61, except two successive ones. See Jforum Raul Miller 73786976294838206000 #.66#1 3.333 Neat that it's a ratio of exactly 10r3 -- Dan Bron <>