Trisquel flidas has Basic-256, an educational form of Basic, so I'll start
with that.
I doubt anybody wrote in Basic-256 an efficient code to sample a
Zipf-distributed random variable. If you do not care about efficiency that
much, that AWK program (which computes the CDF for each realization!) seems
to work:
$ prefix=0123:4567; sample_size=10; od -A n -N $(expr $sample_size \* 48)
-dw8 /dev/urandom | awk -Mv prefix=$prefix -v PREC=64 'NR % 6 == 1 { printf
prefix } { n = 0; for (p = 0; p != 4; ++p) n += $(p + 1) * 65536^p; n *=
6.3250068069543573221e-19; cdf = 1; for (i = 2; n > cdf; ++i) cdf += 1 / i;
printf ":%04x", i - 2 } NR % 6 == 0 { print "" }'
0123:4567:978b:09de:000b:0d8a:0003:016b
0123:4567:0541:0000:0072:d2f3:075f:01d7
0123:4567:52fc:03d3:0056:323a:0569:00ad
0123:4567:0004:06ba:7260:0005:000c:00c6
0123:4567:0016:0059:ec66:0014:0017:07a2
0123:4567:02ac:0001:0161:0004:02c9:5288
0123:4567:3309:0000:571d:0005:0000:0252
0123:4567:0085:0023:0000:002d:0002:1031
0123:4567:6d52:0001:6174:00a6:0c63:0b12
0123:4567:0027:0026:036e:0027:0003:0037
On my system, This command provides ~43 addresses per second. The exponent
of the Zipfian distribution is here 1: except for the two first group of four
hexadecimal digits (the "prefix" shell variable fixes them), 0000 occurs
twice more than 0001, three times more than 0002 and so on.
I do not understand the problem you tried to explain at the end of your post:
please show the command line you executed, its output, and describe the
expected one.