As noted, language-dependent for sure. APL looks appropriate for this… but… Wikipedia says this code snipped finds all of the prime numbers up to R...
(~R∊R∘.×R)/R←1↓⍳R
which is 17 characters, and you need to feed it a top of range. Machine code wins!
By the way, machine-code symbols are already pretty close to Huffman-coded.
As noted, language-dependent for sure. APL looks appropriate for this… but… Wikipedia says this code snipped finds all of the prime numbers up to R...
(~R∊R∘.×R)/R←1↓⍳R
which is 17 characters, and you need to feed it a top of range. Machine code wins!
By the way, machine-code symbols are already pretty close to Huffman-coded.