Showing posts with label wr. Show all posts
Showing posts with label wr. Show all posts

Thursday, October 15, 2026

[ijyxrmio] counting words

n letters in the alphabet, maximum word length k, letter repetitions permitted.  (future post repetitions not permitted.)  how many distinct words are possible, including the empty string?

g(n,k) = sum(i=0, k, n^i)

(defining 0^0 = 1)

g(0,k) = 1 for all k.  if empty alphabet, only the empty string possible.

g(1,k) = k+1 .  unary strings of length up to k, including length 0.

g(2,k) = 2^(k+1) - 1

for(i=0, 10, print(i" ",g(2,i)))

0 1
1 3
2 7
3 15
4 31
5 63
6 127
7 255
8 511
9 1023
10 2047

for(i=0, 10, print(i" ",g(10,i)))

0 1
1 11
2 111
3 1111
4 11111
5 111111
6 1111111
7 11111111
8 111111111
9 1111111111
10 11111111111

k-digit repunits of base n:

g(n,k) = (n^(k+1) - 1) / (n-1)
if n != 1 (can this restriction be removed with cleverness?).

k = 4 is intriguing for inventing a Chinese or Korean style writing system: up to 4 radicals or jamo in a square block, with a convention for extracting their order, e.g., read top to bottom, left to right.  padding or stretching if less than 4 items.

for(i=0, 27, x=g(i,4); print(i" "x" ",x-1))

0 1 0
1 5 4
2 31 30
3 121 120
4 341 340
5 781 780
6 1555 1554
7 2801 2800
8 4681 4680
9 7381 7380
10 11111 11110
11 16105 16104
12 22621 22620
13 30941 30940
14 41371 41370
15 54241 54240
16 69905 69904
17 88741 88740
18 111151 111150
19 137561 137560
20 168421 168420
21 204205 204204
22 245411 245410
23 292561 292560
24 346201 346200
25 406901 406900
26 475255 475254
27 551881 551880

g(4,k)-1 omits the empty string, reserving it to be a character (word) separator.

values g(n,k) <= 1000, 2 <= n, 2 <= k :

7 g(2,2)
13 g(3,2)
15 g(2,3)
21 g(4,2)
31 g(2,4)
31 g(5,2)
40 g(3,3)
43 g(6,2)
57 g(7,2)
63 g(2,5)
73 g(8,2)
85 g(4,3)
91 g(9,2)
111 g(10,2)
121 g(3,4)
127 g(2,6)
133 g(11,2)
156 g(5,3)
157 g(12,2)
183 g(13,2)
211 g(14,2)
241 g(15,2)
255 g(2,7)
259 g(6,3)
273 g(16,2)
307 g(17,2)
341 g(4,4)
343 g(18,2)
364 g(3,5)
381 g(19,2)
400 g(7,3)
421 g(20,2)
463 g(21,2)
507 g(22,2)
511 g(2,8)
553 g(23,2)
585 g(8,3)
601 g(24,2)
651 g(25,2)
703 g(26,2)
757 g(27,2)
781 g(5,4)
813 g(28,2)
820 g(9,3)
871 g(29,2)
931 g(30,2)
993 g(31,2)

OEIS A031973 if n = k.

Friday, August 07, 2026

[ekzfaacc] first differences of prime indices of known Mersenne prime exponents

OEIS A135701

previously.

the lists below were computed from the known Mersenne primes as of March 2026.  if copying by hand, line numbers make it easier to rewrite a line correcting a mistake.  the last few entries might be incorrect because there might be more Mersenne primes in untested gaps before the largest known Mersenne prime.

in decimal:

  1. 1
  2. 1
  3. 1
  4. 2
  5. 1
  6. 1
  7. 3
  8. 7
  9. 6
  10. 4
  11. 3
  12. 67
  13. 13
  14. 96
  15. 121
  16. 11
  17. 116
  18. 128
  19. 19
  20. 594
  21. 30
  22. 131
  23. 897
  24. 181
  25. 156
  26. 2033
  27. 3760
  28. 2105
  29. 1842
  30. 6961
  31. 41453
  32. 7556
  33. 28716
  34. 9974
  35. 108217
  36. 3031
  37. 256669
  38. 402707
  39. 452111
  40. 179537
  41. 113178
  42. 258898
  43. 126198
  44. 263183
  45. 313608
  46. 26616
  47. 833014
  48. 906643
  49. 166801
  50. 294338
  51. 2901904

in binary, substituting lower case letter o for zero to make the digits easier to distinguish by height (unless your font does lowercase numeral 1):

1. 1
1o. 1
11. 1
1oo. 1o
1o1. 1
11o. 1
111. 11
1ooo. 111
1oo1. 11o
1o1o. 1oo
1o11. 11
11oo. 1oooo11
11o1. 11o1
111o. 11ooooo
1111. 1111oo1
1oooo. 1o11
1ooo1. 111o1oo
1oo1o. 1ooooooo
1oo11. 1oo11
1o1oo. 1oo1o1oo1o
1o1o1. 1111o
1o11o. 1ooooo11
1o111. 111oooooo1
11ooo. 1o11o1o1
11oo1. 1oo111oo
11o1o. 1111111ooo1
11o11. 111o1o11oooo
111oo. 1ooooo111oo1
111o1. 111oo11oo1o
1111o. 11o11oo11ooo1
11111. 1o1oooo1111o11o1
1ooooo. 111o11oooo1oo
1oooo1. 111oooooo1o11oo
1ooo1o. 1oo11o1111o11o
1ooo11. 11o1oo11o1o111oo1
1oo1oo. 1o1111o1o111
1oo1o1. 11111o1o1o1oo111o1
1oo11o. 11ooo1oo1o1ooo1oo11
1oo111. 11o111oo11ooooo1111
1o1ooo. 1o1o1111o1o1o1ooo1
1o1oo1. 11o111o1oooo11o1o
1o1o1o. 111111oo11o1o1oo1o
1o1o11. 1111o11oo1111o11o
1o11oo. 1ooooooo1oooooo1111
1o11o1. 1oo11oo1oo1oooo1ooo
1o111o. 11oo11111111ooo
1o1111. 11oo1o11o1o11111o11o
11oooo. 11o111o1o1o11oo1oo11
11ooo1. 1o1ooo1o111oo1ooo1
11oo1o. 1ooo11111o111oooo1o
11oo11. 1o11ooo1ooo1111oo1oooo

791 bits including line numbers.  542 bits without.

[yceqydqe] counting by scores

what if counting in English were base 20?  (inspired by French which is partially base 20.)

should 20-39 be "score" or "one score"?  can "and" be omitted?  is there a word for "four hundred"?

0 zero
1 one
2 two
3 three
4 four
5 five
6 six
7 seven
8 eight
9 nine
10 ten
11 eleven
12 twelve
13 thirteen
14 fourteen
15 fifteen
16 sixteen
17 seventeen
18 eighteen
19 nineteen
20 score
21 score and one
22 score and two
23 score and three
24 score and four
25 score and five
26 score and six
27 score and seven
28 score and eight
29 score and nine
30 score and ten
31 score and eleven
32 score and twelve
33 score and thirteen
34 score and fourteen
35 score and fifteen
36 score and sixteen
37 score and seventeen
38 score and eighteen
39 score and nineteen
40 two score
41 two score and one
42 two score and two
43 two score and three
44 two score and four
45 two score and five
46 two score and six
47 two score and seven
48 two score and eight
49 two score and nine
50 two score and ten
51 two score and eleven
52 two score and twelve
53 two score and thirteen
54 two score and fourteen
55 two score and fifteen
56 two score and sixteen
57 two score and seventeen
58 two score and eighteen
59 two score and nineteen
60 three score
61 three score and one
62 three score and two
63 three score and three
64 three score and four
65 three score and five
66 three score and six
67 three score and seven
68 three score and eight
69 three score and nine
70 three score and ten
71 three score and eleven
72 three score and twelve
73 three score and thirteen
74 three score and fourteen
75 three score and fifteen
76 three score and sixteen
77 three score and seventeen
78 three score and eighteen
79 three score and nineteen
80 four score
81 four score and one
82 four score and two
83 four score and three
84 four score and four
85 four score and five
86 four score and six
87 four score and seven (Lincoln's Gettysburg Address)
88 four score and eight
89 four score and nine
90 four score and ten
91 four score and eleven
92 four score and twelve
93 four score and thirteen
94 four score and fourteen
95 four score and fifteen
96 four score and sixteen
97 four score and seventeen
98 four score and eighteen
99 four score and nineteen
100 five score
101 five score and one
102 five score and two
103 five score and three
104 five score and four
105 five score and five
106 five score and six
107 five score and seven
108 five score and eight
109 five score and nine
110 five score and ten
111 five score and eleven
112 five score and twelve
113 five score and thirteen
114 five score and fourteen
115 five score and fifteen
116 five score and sixteen
117 five score and seventeen
118 five score and eighteen
119 five score and nineteen
120 six score
121 six score and one
122 six score and two
123 six score and three
124 six score and four
125 six score and five
126 six score and six
127 six score and seven
128 six score and eight
129 six score and nine
130 six score and ten
131 six score and eleven
132 six score and twelve
133 six score and thirteen
134 six score and fourteen
135 six score and fifteen
136 six score and sixteen
137 six score and seventeen
138 six score and eighteen
139 six score and nineteen
140 seven score
141 seven score and one
142 seven score and two
143 seven score and three
144 seven score and four
145 seven score and five
146 seven score and six
147 seven score and seven
148 seven score and eight
149 seven score and nine
150 seven score and ten
151 seven score and eleven
152 seven score and twelve
153 seven score and thirteen
154 seven score and fourteen
155 seven score and fifteen
156 seven score and sixteen
157 seven score and seventeen
158 seven score and eighteen
159 seven score and nineteen
160 eight score
161 eight score and one
162 eight score and two
163 eight score and three
164 eight score and four
165 eight score and five
166 eight score and six
167 eight score and seven
168 eight score and eight
169 eight score and nine
170 eight score and ten
171 eight score and eleven
172 eight score and twelve
173 eight score and thirteen
174 eight score and fourteen
175 eight score and fifteen
176 eight score and sixteen
177 eight score and seventeen
178 eight score and eighteen
179 eight score and nineteen
180 nine score
181 nine score and one
182 nine score and two
183 nine score and three
184 nine score and four
185 nine score and five
186 nine score and six
187 nine score and seven
188 nine score and eight
189 nine score and nine
190 nine score and ten
191 nine score and eleven
192 nine score and twelve
193 nine score and thirteen
194 nine score and fourteen
195 nine score and fifteen
196 nine score and sixteen
197 nine score and seventeen
198 nine score and eighteen
199 nine score and nineteen
200 ten score
201 ten score and one
202 ten score and two
203 ten score and three
204 ten score and four
205 ten score and five
206 ten score and six
207 ten score and seven
208 ten score and eight
209 ten score and nine
210 ten score and ten
211 ten score and eleven
212 ten score and twelve
213 ten score and thirteen
214 ten score and fourteen
215 ten score and fifteen
216 ten score and sixteen
217 ten score and seventeen
218 ten score and eighteen
219 ten score and nineteen
220 eleven score
221 eleven score and one
222 eleven score and two
223 eleven score and three
224 eleven score and four
225 eleven score and five
226 eleven score and six
227 eleven score and seven
228 eleven score and eight
229 eleven score and nine
230 eleven score and ten
231 eleven score and eleven
232 eleven score and twelve
233 eleven score and thirteen
234 eleven score and fourteen
235 eleven score and fifteen
236 eleven score and sixteen
237 eleven score and seventeen
238 eleven score and eighteen
239 eleven score and nineteen
240 twelve score
241 twelve score and one
242 twelve score and two
243 twelve score and three
244 twelve score and four
245 twelve score and five
246 twelve score and six
247 twelve score and seven
248 twelve score and eight
249 twelve score and nine
250 twelve score and ten
251 twelve score and eleven
252 twelve score and twelve
253 twelve score and thirteen
254 twelve score and fourteen
255 twelve score and fifteen
256 twelve score and sixteen
257 twelve score and seventeen
258 twelve score and eighteen
259 twelve score and nineteen
260 thirteen score
261 thirteen score and one
262 thirteen score and two
263 thirteen score and three
264 thirteen score and four
265 thirteen score and five
266 thirteen score and six
267 thirteen score and seven
268 thirteen score and eight
269 thirteen score and nine
270 thirteen score and ten
271 thirteen score and eleven
272 thirteen score and twelve
273 thirteen score and thirteen
274 thirteen score and fourteen
275 thirteen score and fifteen
276 thirteen score and sixteen
277 thirteen score and seventeen
278 thirteen score and eighteen
279 thirteen score and nineteen
280 fourteen score
281 fourteen score and one
282 fourteen score and two
283 fourteen score and three
284 fourteen score and four
285 fourteen score and five
286 fourteen score and six
287 fourteen score and seven
288 fourteen score and eight
289 fourteen score and nine
290 fourteen score and ten
291 fourteen score and eleven
292 fourteen score and twelve
293 fourteen score and thirteen
294 fourteen score and fourteen
295 fourteen score and fifteen
296 fourteen score and sixteen
297 fourteen score and seventeen
298 fourteen score and eighteen
299 fourteen score and nineteen
300 fifteen score
301 fifteen score and one
302 fifteen score and two
303 fifteen score and three
304 fifteen score and four
305 fifteen score and five
306 fifteen score and six
307 fifteen score and seven
308 fifteen score and eight
309 fifteen score and nine
310 fifteen score and ten
311 fifteen score and eleven
312 fifteen score and twelve
313 fifteen score and thirteen
314 fifteen score and fourteen
315 fifteen score and fifteen
316 fifteen score and sixteen
317 fifteen score and seventeen
318 fifteen score and eighteen
319 fifteen score and nineteen
320 sixteen score
321 sixteen score and one
322 sixteen score and two
323 sixteen score and three
324 sixteen score and four
325 sixteen score and five
326 sixteen score and six
327 sixteen score and seven
328 sixteen score and eight
329 sixteen score and nine
330 sixteen score and ten
331 sixteen score and eleven
332 sixteen score and twelve
333 sixteen score and thirteen
334 sixteen score and fourteen
335 sixteen score and fifteen
336 sixteen score and sixteen
337 sixteen score and seventeen
338 sixteen score and eighteen
339 sixteen score and nineteen
340 seventeen score
341 seventeen score and one
342 seventeen score and two
343 seventeen score and three
344 seventeen score and four
345 seventeen score and five
346 seventeen score and six
347 seventeen score and seven
348 seventeen score and eight
349 seventeen score and nine
350 seventeen score and ten
351 seventeen score and eleven
352 seventeen score and twelve
353 seventeen score and thirteen
354 seventeen score and fourteen
355 seventeen score and fifteen
356 seventeen score and sixteen
357 seventeen score and seventeen
358 seventeen score and eighteen
359 seventeen score and nineteen
360 eighteen score
361 eighteen score and one
362 eighteen score and two
363 eighteen score and three
364 eighteen score and four
365 eighteen score and five
366 eighteen score and six
367 eighteen score and seven
368 eighteen score and eight
369 eighteen score and nine
370 eighteen score and ten
371 eighteen score and eleven
372 eighteen score and twelve
373 eighteen score and thirteen
374 eighteen score and fourteen
375 eighteen score and fifteen
376 eighteen score and sixteen
377 eighteen score and seventeen
378 eighteen score and eighteen
379 eighteen score and nineteen
380 nineteen score
381 nineteen score and one
382 nineteen score and two
383 nineteen score and three
384 nineteen score and four
385 nineteen score and five
386 nineteen score and six
387 nineteen score and seven
388 nineteen score and eight
389 nineteen score and nine
390 nineteen score and ten
391 nineteen score and eleven
392 nineteen score and twelve
393 nineteen score and thirteen
394 nineteen score and fourteen
395 nineteen score and fifteen
396 nineteen score and sixteen
397 nineteen score and seventeen
398 nineteen score and eighteen
399 nineteen score and nineteen

previously, digits in base 20.

[foyujkfq] digits of base 20

we need 10 additional characters for digits of base 20.  let's choose them from the letters as hexadecimal does, but avoid similar looking characters:

A a similar to 4
B b similar to 8 and 6
C c 10
D d similar to 0
E e 11
F f 12
G g similar to 6 and 9
H h 13
I i similar to 1
J j 14
K k 15
L l similar to 1
M m 16
N n similar to h
O o similar to 0
P p similar to h
Q q similar to 0 and 9
R r similar to h
S s similar to 5
T t similar to J
U u 17
V v similar to U and R
W w 18
X x 19
Y y similar to X
Z z similar to 2

so

0 1 2 3 4 5 6 7 8 9
C E F H J K M U W X
c e f h j k m u w x

dyslexics might dislike having both 3 and E, but we are not fixing 2 and 5, nor the non-dyslexic similar characters 1 and 7, and 4 and 9.

lowercase h p n r v are all handwritten with similar motion, so we only include h.

other posts: base 20 English and French.  Plus Codes.

Sunday, April 19, 2026

[esowrowp] speaking leading zeroes

zeroty ten twenty thirty forty fifty sixty seventy eighty ninety

0 zero
1 one
00 zeroty
01 zeroty one
000 zero hundred
001 zero hundred one
0000 zero thousand
0001 zero thousand one
00000 zeroty thousand
00001 zeroty thousand one
01000 zeroty one thousand
000000 zero hundred thousand

or "ohty" instead of zeroty to avoid similarity between zero and zeroty?  but ohty sounds similar to eighty.

or "aughty"?  also sounds similar to eighty.

or "noughty"?  context probably distinguishes it from naughty.

"nohty" ("notey")?

typically digit strings that are not numbers should be read as digit strings, but place value indicators inserted into the string serve as useful signposts.  in this case, also consider speaking internal zeroes: 

000000 zero hundred zeroty zero thousand, zero hundred zeroty zero
20 twenty zero

zip codes

10 "ten" remains irregular.  though could we do something like 10 one-ty zero, 20 two-ty zero (future post knlwtvtb).

Saturday, November 01, 2025

[lrppbqqi] word primes

below are the 129 primes less than 27^2 = 729, written in big-endian base 27, using the following straightforward encoding of base-27 digits:

a=1 b=2 c=3 d=4 e=5 f=6 g=7 h=8 i=9 j=10 k=11 l=12 m=13 n=14 o=15 p=16 q=17 r=18 s=19 t=20 u=21 v=22 w=23 x=24 y=25 z=26

b c e g k m q s w ab ad aj an ap at az be bg bm bq bs by cb ch cp ct cv cz da de ds dw eb ed en ep ev fa fe fk fq fs gb gd gh gj gv hg hk hm hq hw hy ih in it iz ja jg jk jm jw kj kn kp kt lg lm lw ly mb mh mp mv na ne nk ns nw od on op oz pa pg pk pq py qb qd qh qt ra re rm rq rw sh sj ta tg tq tw ub ud uj ut uz ve vg vm vs vw vy wj wt wv wz xe xk xm xy yb yh yp yz zg zq zy

there are 9 1-digit primes and 120 2-digit primes.

the digits c f i l o r u x corresponding to multiples of 3 never occur as the last (units) digit, except for c by itself.

for 1- and 2-digit primes, we do not need a symbol to represent zero.  the first digit cannot be zero because that would be a useless leading zero.  if the second digit were zero, the number would be a multiple of 27, so not prime.

future work: consider a prime base so that all letters can occur in the units place.  deal with the special case "10" by ignoring it.  what two characters should we add to reach the 28 letters needed for base 29, and where in the alphabet should we add them?  or which 4 should we eliminate for base 23?  (probably wxyz.)

for the 2098 3-digit primes between 27^2 = 729 and 27^3 = 19683 below, we do need a symbol for zero as a middle character.  we choose dash (hyphen), mimicking English orthography.  (apostrophe was another good option.)

for 4-digit primes and larger (not explored), we could have multiple dashes in a row which are hard to distinguish in fonts that meld them into a single line, so some other symbol (e.g., apostrophe) for zero would be better.  or, do base 26 instead of base 27: there will be no words starting with a=0.  (or, make z the zeroth letter.  x is another good choice for zero, unlikely to begin a word.)

these primes could be the dictionary for a weird game of Scrabble.  blank is zero.  reorder the alphabet so that the frequency of Scrabble letter tiles correspond to the frequency of letters among 2-digit primes.

which English words are primes?  this should be easy.  assuming we stick with base 27, choose a different mapping of letters to digits so that multiples of 3 correspond to the letters least likely to end a word.  or begin a word if encoding little-endian.  find the mapping of letters to digits that maximizes the number of prime English words.

a-d a-j a-n a-v aaa aae aam aaq abd abn abz aca ack acm acq acs adb adp adt adv adz aem aeq aes aew afp aft aga agk ags agw ahb ahh ahv ahz aie aik ais aiy ajj ajn ajt ajv ake akg akm akw aky alh alj alp amg amk amm amq amw anb anj anp anv aoq aos apb apj apt apz aqe aqm aqy arb arh arn arp arv asg asq ath atj atn att atv aua aue aug auk auw auy avd awk awq aww axd axv aye ays ayw ayy azb azh azp azt azv b-a b-m b-w b-y bab bad bah ban baz bbk bbs bcd bcj bcn bct bda bde bdm bdq bed beh ben bep bet bez bfa bfg bfq bgj bgp bgt bgv bhs bhw bhy bih bit biv bje bjm bjs bjy bkd bkv bla ble blg bls bmb bmn bmv bnk bny bod boh boj bon bop boz bpk bpq bpw bqn bqp bre brg bsb bsh bsp bsv bsz bta bte btm bts bub bud bun bva bvk bvq bwb bwd bwh bwj bwt bxe bxg bxw bxy byd byh byj byt bza bzs c-p c-t c-z cag caw cay cbb cbj cbz cca cce ccm ccs ccy cdb cdn cdp cek ceq ces cey cfb cfh cfv cga cge cgg cgm cgq cgw chh chn cht cig cik ciq cjb cjj cjp cjt cks clj clt cma cme cmk cmm cms cnn cnz coa coq coy cpb cpn cqa cqk cqm cqq cqy crd crj crn crp crt crz csg csk csm css ctb ctd ctn ctv ctz cum cuw cvh cvj cvp cvt cvv cwk cwy cxb cxh cxp cxv cxz cyq cyy czh czn czt d-a d-k d-w daj dan dat daz dba dcb dcd dcn dcv dcz ddm ddq ddy dej dep dfa dfe dfk dgd dgn dgp dhe did dih dij div dja dje djq djw dkd dkh dkp dlk dlm dlq dls dmd dne dng dnm dns dny dob doh doj dov doz dpk dpm dpw dpy dqn dqp dre drk dsd dst dta dte dtg dtk dtm duh dup dva dvg dvq dvs dvw dwb dwd dwj dwt dwv dxg dxq dxs dyb dyp dyv dyz dze dzm dzs dzy e-n e-z eaa eae eas eay ebb ebj ebt eca ecg ecm edh edn edp edz eem eeq eew efn efp efz egm egq egs ehb ehp eht eia eis eiw ejb ejd ejh ejn ejp eka eke eky elt eme emg emk emq emw emy end enz eoa eog eow epb epn epp epv eqg eqw eqy erb erh erv erz esa ess etp etz eue eug euq eus evb evd evn evt evv ewe ewg ewq eww exd eyg eyq eys ezb ezj ezp ezz f-q f-w fah fat fav fbm fbs fbw fcb fch fcz fda fdk fdy fed feh fej fen ffk ffm ffy fgd fgt fha fhg fhm fid fit fiv fiz fje fjg fjm fjs fkb fkh fkt fle flw fly fmd fmh fmz fng fod foh foj fon fot fov fpg fpk fpy fra frk frq fsb fsp fsv fte ftq fts ftw fub fuj fup fuz fva fve fvs fvy fwd fwh fwn fwp fwz fxa fxq fyb fyj fza fze fzk fzw fzy g-d g-j g-p gaq gaw gbj gbn gbv gce gcm gcy gdp gdt gdv gdz gew gfh gfn gfp gge ggk ggq ghd ghn gia gie gjh gjn gjt gjz gkg gkm gkq gks gld glj gln glp glv gmq gmw gmy gnb gnt gnv gnz gok gom gos gow gpv gqa gqg gqk gqs grb gsg gsw gsy gtd gth gtj gtn gtp gtz gum gus guw gvd gvn gvt gwm gwq gws gwy gya gye gym gyw gzb gzh gzp gzv h-g h-k h-q h-s h-y hab hah haj hat hav hbk hbq hcj hcn hcz hdm hen het hfm hfq hgh hgp hgv hgz hhe hhs hhy hid hin hip hiz hjk hjs hkb hkd hkn hkv hlg hlq hmn hmp hmt hna hng hnk hns hoj hot hoz hpe hpg hpm hpw hqh hqj hqt hqz hre hrk hrs hry hsh hsn hsp hsv hta htg htq hty huv hva hvw hvy hwp hwt hxa hxk hyn hyv hzm hzq hzs i-b i-h i-j i-p i-t iak ias ibd ibv ick icq ics idd idj idt idv iee ieg iem iew ifj ifn igk igm ihb ihd ihn ihp ihz iis iiw iiy ijb ijj ijz ike ikk ikm iky iln ilv ilz ime inh inj int inv ioa ioe iok ioq ioy ipd iph ipt ipz iqg iqs iqw irj irv ise itb ith itt itz iua iuw ivd ivv iwe iwk iwy ixb ixd ixj ixt iya iyg iyk iyq izt j-g j-q j-s jad jan jap jbe jbg jby jcv jdm jds jeh jez jfe jfg jfy jgb jgh jgj jgt jha jhk jhq jhw jid jih jin jip jiz jja jjm jjq jjw jkb jkd jkp jkt jlg jly jmb jmh jna jne jnm jns jnw jod joh jov jpa jpe jps jqd jqh jqj jrm jrq jsn jst jsz jtk jtw juj jup jut juv juz jvq jvw jwh jwp jwv jwz jxk jxm jxy jza jzq jzs jzy k-t kag kam kaw kbh kbn kbp kbt kca kck kcq kcw kdt keg kem keq key kfj kga kgk kgm kgw kgy khb khh kia kig kik kiy kjb kjd kjh kjv kka kkm klj klt klz kmg kmq kms knv knz koe kog kos kow kpj kpp kqw krh krp krv kse ksg ksk ktd ktn ktv kuk kum kuw kvj kvn kvp kwa kwg kww kxb kxj kxn kxv kxz kye kym kys kyy kzj kzp kzt kzz l-e l-m lad lah lba lbe lbq lbs lcb lch lcj lct lde ldg ldk led lej lfm lfs lfw lgd lgn lgz lhe lhg lih lij lip lit liv ljk ljw ljy lkd lkn lkv lls lmd lmj lna lng lnk lny lod loh lot lpa lpg lps lpw lqb lqn lqt lre lrg lrw lsp lst lsv lte ltw lud luh luv luz lva lvg lwb lwh lwv lxa lxg lxq lxw lxy lyh lyj lyn lyp lzk lzm lzq lzw m-b m-n m-t mag maq mbb mbh mbp mbt mdb mdp mea meg mek meq mes mfd mfj mfv mgk mgm mgw mhd mhz mia mim mis miw mjb mjt mjv mkg mkm mkq mlb mlj mlp mma mme mmk mmw mnb mnd mnp moa moe mos moy mpn mpt mpv mqe mqm mrd mrj msq mss mtt mtv muq muw muy mvh mvt mvv mwa mwe mwm mxh mxn mxp mxz myg myk myq myy mzb mzn n-e n-q naj nan nat naz nbg nbk nbm ncb ncn ncp ncz ndg ndq nds ndw neb nep nfa nfw ngd nhe nhg nhk nid nih nij nin nja njk njw njy nkj nkz nla nmb nmj nne nnm nnq nnw nob nop not npa npm nps npy nqb nqv nqz nrq nrs nsd nsj nsn nst ntg nty nuh nup nuz nwd nwj nwt nwz nxe nxg nxm nyb nyh nyj nyv nza o-b o-d o-n o-v oak oaq oay obd obn ock odd odn odp odz oea oem oeq oew ofp oft ofv ogg ogy ohh ohj oht ohv ohz ois ojh okg okk oks oky olb oln olt oma omm omy ond onh onp ook oom opb opp opz oqe oqq orb orp orv orz oss osw oth otn otp otv oua ouq ouy ovt ovv oww oxd oxj oxn oyg oyk oyw ozt p-m p-q p-y pah paj paz pba pbm pby pde pdg pdk pdq peb peh pen pev pfa pfe pfg pfm pgj pgn phg phq phw pib pip pit piz pje pjg pjs pjy pkh pkj pkt pkz pls plw pmv pmz pna png pob pod ppa ppe ppk ppm ppq ppw pqt pqz prg prk prm pst psz ptg ptw puh puj put puv pve pvk pvs pvw pwd pwp pxk pxq pyd pyh pzg pzk pzm pzy q-h q-p q-t qaa qam qaq qbd qbj qbz qce qcm qcq qcw qdb qdj qdp qdz qek qem qes qey qfn qfv qga qgg qgs qhb qhd qhj qia qie qik qiq qiw qjh qjz qkg qkm qkw qld qlv qlz qmm qms qnj qnt qoa qok qow qoy qpd qpp qqa qrj qrn qrt qsa qse qsk qsm qsq qth qtt qtz qug qum qus quw qvn qvp qvt qvv qws qww qxb qxh qxv qyy qzd qzh qzn qzz r-e r-y rab raj ran rav rba rbg rbk rcn rcp rcz rdk rds reb rej rfg rfm rfy rgb rgp rgt rgz rha rib rip rje rjg rjs rjy rkb rkv rle rlk rlq rlw rmd rmn rmz rnm rnw roj roz rpm rpw rqj rqp rre rrk rrs rry rsn rtg rtq rts rty rub rud ruh rut ruv rve rvg rvm rwh rwn rwp rwt rxk rxs ryb ryj rze rzg rzq s-h s-v s-z saa sae saw say sbb sbh sbp sbz sca sdd sdh sek sem sew sey sfp sft sgk sgq shd shn shp sht sim sjv ska ske skk sky slb slv sme sms snn snt snv soy spj spt sqk sqm sqq srd srj sse ssw ssy stj stp stt sua sue sum sus svb svd svp swg swq sxd sxt syg syk syq syw syy szd szh szj t-k t-m tan tat tav taz tbe tbs tbw tch tcv tdk tdy teb teh tep tev tez tfe tfk tfq tfy tgb tgj tgn tha thq thy tid tih tit tja tjq tjs tkb tkj tkn tkt tls tly tmh tmp tmt tmz tnk tny tpa tpe tps tqn tqv trg trk trq try tsh tsn tta ttk ttq tts tub tun tuz tvm tvs tvy twp twz txe txm tyd tyh tyn typ tyv tze tzg tzq tzy u-d u-j u-t u-v uam uaw uay ubj ubn ubt uca uck ucw udj udv udz ueg ueq uew ufb ufv ufz ugm uhb uhp uhz uig uiq ujb ujd ujv uka ukm ukw ulh ulj uln ulp uma umg umk ums umw uom uoq uos uow uoy uph upt upz uqe uqs uqw urb urh urn urv usa utj uua uue uuk uum uuy uvd uvj uvp uvt uwg uxb uxn uxp uyg uyq uyw uzv v-s v-w v-y vab vad vah vav vaz vbe vbk vbs vch vct vcv vej ven vep vet vfq vfw vgb vgd vgv vgz vhm vhs vit vjk vjy vkd vkn vkz vla vlg vls vmv vna vne vnk vnq vod voh voj vpg vpk vpq vpw vqv vre vrw vsb vsj vsp vsv vty vub vun vuz vva vvq vvs vvy vwb vwn vxe vxg vxm vxq vyp vza vzg vzs vzw w-t waq wbb wbh wbj wbv wcw wdd wdh wdn wdz wea wes wey wfb wfh wfn wgg wgw wgy whd whj wia wik wiq wis wiw wjd wjj wjp wkm wlb wlh wlp wlz wme wms wnn wnv wok woq wos wpd wph wpj wqe wqm wrd wsk wsm wss wtj wtn wtt wtz wug wuq wuy wvp wvv wvz wwa wwe wwm wxb wxd wxp wya wyg wyy wzb wzh wzn wzt wzv x-a x-m x-w xap xba xbs xbw xcb xcd xct xcv xde xds xdw xez xfa xfk xfw xfy xgv xha xhq xhy xih xij xiv xjq xjw xjy xkn xlg xlq xls xmd xmp xng xnq xob xoh xoj xot xov xpa xpk xqb xqd xqp xqv xqz xre xrg xsd xte xtg xtk xtm xtw xty xun xuz xvg xwb xwd xwj xwn xwp xwz xxe xxy xyj xyt xza xzm xzs xzy y-d y-h y-z yaa yae yaq ybh ybj ybv yca yce ycg ycw ydh ydt yeg yek yes yfj yfn yfz ygm ygs ygy yhb yhj yhp yht yim yiy yjh yjv yjz yka ykq yks yld ymg ymk ymq ynn yog ypd ypn ypv yqg yqq yrb yrh yrt yse ysk yss yth ytv yua yue yuk yvt ywm yww yxz yyk yym yyq yys yzt z-e z-s z-y zat zba zbe zbw zcb zcp zdg zdk zdq zds zdy zfe zfw zfy zgn zgt zhk zhm zij zin zip ziv zjg zjm zjy zkh zkp zkv zlk zlw zmd zmn zna zon zot zov zpa zpe zpq zqd zqh zqj zqn zqp zqt zra zrg zrq zrw zsb zsd zsj zsp zsv ztg ztm zuj zut zuv zve zvk zvw zwb zwh zwv zxa zxg zze zzy

Saturday, May 17, 2025

[bfganmsg] balanced ternary

first, here are integers from -20 to 100.  to negate a balanced ternary number, swap + and -, leave 0 unchanged.

-+-+-20
-+0--19
-+00-18
-+0+-17
-++--16
-++0-15
-+++-14
----13
--0-12
--+-11
-0--10
-00-9
-0+-8
-+--7
-+0-6
-++-5
---4
-0-3
-+-2
--1
00
+1
+-2
+03
++4
+--5
+-06
+-+7
+0-8
+009
+0+10
++-11
++012
+++13
+---14
+--015
+--+16
+-0-17
+-0018
+-0+19
+-+-20
+-+021
+-++22
+0--23
+0-024
+0-+25
+00-26
+00027
+00+28
+0+-29
+0+030
+0++31
++--32
++-033
++-+34
++0-35
++0036
++0+37
+++-38
+++039
++++40
+----41
+---042
+---+43
+--0-44
+--0045
+--0+46
+--+-47
+--+048
+--++49
+-0--50
+-0-051
+-0-+52
+-00-53
+-00054
+-00+55
+-0+-56
+-0+057
+-0++58
+-+--59
+-+-060
+-+-+61
+-+0-62
+-+0063
+-+0+64
+-++-65
+-++066
+-+++67
+0---68
+0--069
+0--+70
+0-0-71
+0-0072
+0-0+73
+0-+-74
+0-+075
+0-++76
+00--77
+00-078
+00-+79
+000-80
+000081
+000+82
+00+-83
+00+084
+00++85
+0+--86
+0+-087
+0+-+88
+0+0-89
+0+0090
+0+0+91
+0++-92
+0++093
+0+++94
++---95
++--096
++--+97
++-0-98
++-0099
++-0+100

binary and balanced ternary vie to be the most elegant base.  the following list of the powers of 2 is an artistic rendition of an irrational impedance mismatch between base 2 and base 3.  previously, on log(3)/log(2): [1],[2],[3].

+2^01
+-2^12
++2^24
+0-2^38
+--+2^416
++--2^532
+-+0+2^664
+---+-2^7128
+00+++2^8256
+-0+00-2^9512
+++-0-+2^101024
+0-++0--2^112048
+-0-0--0+2^124096
++-+-0++-2^138192
+-+++++-++2^1416384
+--0000--0-2^1532768
+0+000-0+-+2^1665536
+-+-00-++---2^17131072
++++00--+00+2^18262144
+000-0-+--0+-2^19524288
+-00-+-++0+0++2^201048576
++00---0-+-+0-2^212097152
+0-0-00+0-----+2^224194304
+--+-+0+--000+--2^238388608
++----0+0+000+0+2^2416777216
+-+000++-+-00+-+-2^2533554432
+---00+-++++00++++2^2667108864
+00+0+--000-0+000-2^27134217728
+-0+-0+0+00-++-00-+2^28268435456
++0+++-+-00--++00--2^29536870912
+0-+0-++++0-+-0-0-0+2^301073741824
+-0--0-000--+++-+-++-2^312147483648
++-0+-+00-+-00-----++2^324294967296
+-+++---0-+++0-000+-0-2^338589934592
+--0-+00+0-00--+000++-+2^3417179869184
+0+0--0+--+0-+--00+0---2^3534359738368
+-+--0+0++---++0+0+--00+2^3668719476736
+++0++-+-+0+-0-+-0+0+0+-2^37137438953472
+00-+0-----0++-++++-+-0++2^38274877906944
+-00---0000++0--00-+++++0-2^39549755813888
++0-00+000+0--0+00-0000--+2^401099511627776
+0--+0+-00+--0++-0-+000-+--2^412199023255552
+--+--0++00+0++-++0--00-++0+2^424398046511104
+0++0++0-0+-+0--0--0+00-0-+-2^438796093022208
+-+0-+0--++----0+-0++-0-+-+++2^4417592186044416
+---0---+--+000+0+++-++0---00-2^4535184372088832
+00+-00+++--00+-+00--0--00+0-+2^4670368744177664
+-00++0+0-+0+0+---0-0+-0+0+-0--2^47140737488355328
++0+0-+-0--+-0+00+-+0+++-0++-0+2^48281474976710656
+0-+--+++-0++++-0+---+0-+++-+++-2^49562949953421312
+--+++-0-+++00-++0+0+--0-00--0-++2^501125899906842624
++-0-++0-00-00-0-+-0+0+-+0-0+0-0-2^512251799813685248
+-++0-0--+0-+0-+-++++-+----++--+-+2^524503599627370496
+--0--+-+--0--0---00-+++00+--++----2^539007199254740992
+0+-0++++0+-0+-00+00-00-00++--+000+2^5418014398509481984
+-0+++000-0++0++0+-0-+0-+0+-++--00+-2^5536028797018963968
+++00-00-++0-+0-0++0--0--+---+0+00++2^5672057594037927936
+00-0-+00-0-0---++0--0+-0++0+--+-0+0-2^57144115188075855872
+-0-+0--0-+-+-0+-0--0+0+++0-0+0++++--+2^58288230376151711744
++0---0+-+++++0++-0++-+00--++-+00-++--2^59576460752303423488
+0--00++--0000-+-+++0---0-+-0---00--+0+2^601152921504606846976
+--0+0+-+0+0000---00--00+-+++-00+0-+--+-2^612305843009213693952
+0++-+---+-000-00+0-0+0+--0-++0+--++0+++2^624611686018427387904
+-+-+++00+++00-+0+--++-0+0+0-0-0++-0-+00-2^639223372036854775808
+----00-0+00-00--0++--+++-+--+-++-++0--0-+2^6418446744073709551616

Wednesday, January 22, 2025

[uuwzuzas] alphabet of 40 to 50 letters

are there any languages written with an alphabet which has at least one distinct letter per phoneme?

maybe Thai or Korean (Hangul).

by some counts, English has about 44 phonemes, so definitely not English, also evidenced by digraphs such as SH needed to represent phonemes not representable by any single letter.

it is OK to have more letters than phonemes, perhaps for lossless transliteration to and from another language.  Thai does this for Sanskrit.  English similarly has C and K and CK and Q; C and S; F and PH; and X and KS and CKS; and J and ZH, for etymological reasons.

with English doing digraphs and more to signify different sounds, and other languages that use the Latin alphabet adding all sorts of diacritical marks, it is clear that the Latin alphabet is insufficient.  the Romans must have known this, perhaps noticing difficulties in transliterating Greek theta, chi, and others (avoid collision between filia and philia).  it is surprising that some emperor did not try to fix the alphabet by fiat; instead, we and a huge chunk of the world are stuck with the shortcomings of the Latin alphabet and the various gymnastics that we have to do to encode more sounds than letters.

update: Emperor Claudius introduced 3 Claudian letters, but they did not stick.

Thursday, September 26, 2024

[aqyyoppn] relativistic bullet

let

(relativistic kinetic energy) = (relativistic mass-energy) - (rest mass-energy)

(rest mass-energy) = m * c^2

let resq = "remaining speed squared" = c^2 - v^2, having units of speed^2.

aside: lorentz = sqrt(c^2/resq) is unitless.  we prefer to work with resq rather than lorentz because with resq, some mistakes can be caught by dimensional analysis.

aside: for very small v, resq has problems with numerical precision.  for very high v, lorentz has problems with numerical precision.

(relativistic mass-energy) = sqrt(c^2/resq) * m * c^2

(relativistic kinetic energy) = (sqrt(c^2/resq)-1) * m * c^2

assume a bullet has mass 100 grain = 6.49 gram.  (aside: the fact that "in" in grain looks like "m" in gram in some fonts is unfortunate.) (another aside: dram is another unit of mass used in firearms, 1/256 lb.  dram sounds similar to gram.  1 dram = 1.77 gram.  "if you are facing a charging rhino, be sure your shotgun shell is loaded with at least ___ [unintelligible]rams of black powder in order to stop it.  but not too much or the gun will explode in your face.")

(rest mass-energy of 100 grain bullet) = 5.82e14 J

at typical bullet speed 0.0000031622777 c = sqrt(1e-11) c = 3110 ft/s = 2121 mph = 948 m/s : (relativistic kinetic energy) = 2911.9 J

0.01 c : (relativistic kinetic energy) = 2.9121e10 J (3162x speed ~= 10,000,000x energy, matching non-relativistic approximation)

0.1 c : 2.93e12 J (10x speed ~= 100x energy, matching non-relativistic approximation)

0.5 c : 9.01e13 J (50x speed ~= 3094x energy, not 2500x by non-relativistic approximation)

0.866 c = sqrt(0.75) c : 5.82e14 J (kinetic energy equals rest mass-energy)

0.9 c : 7.54e14 J

0.99 c : 3.546e15 J

expressing energy in terms of tons of TNT:

(rest mass-energy) = 5.82e14 J = 139 kiloton tnt

typical bullet speed 0.0000031622777 c : (relativistic kinetic energy) = 696 nanoton tnt = 9.74 grain tnt (which unsurprisingly is in the same order of magnitude as typical amounts of black powder in gun rounds)

0.01 c : 6.96 ton tnt

0.1 c : 701 ton tnt

0.5 c : 21.53 kiloton tnt

0.866 c : 139 kiloton tnt

0.9 c : 180 kiloton tnt

0.99 c : 848 kiloton tnt

inspiration: if a SpaceX Starship (approximately 10 kiloton tnt) were to explode on the launchpad, and a significant fraction of its chemical energy were freakishly transferred into a single bullet-sized piece of debris, how far would be safe distance to view the launch and not get hurt by debris?

answer, assuming no air resistance: there is no safe distance.  inverting the equations above, a bullet with relativistic kinetic energy 10 kiloton tnt has speed 0.36 c.  5 kiloton tnt is 0.26 c, because maybe we care about conservation of momentum.  in comparison, speed of low earth orbit is 0.000026 c, and earth escape velocity is 0.000037 c.  a bullet in orbit can hit anywhere on earth; a bullet escaping earth can hit anywhere in the universe.

the SpaceX Starship is of course trying to deliver payloads much more massive than a bullet into orbit or to infinity.  this fact alone is enough to conclude there is no safe distance.

Wednesday, June 12, 2024

[vkhdrcsg] encoding number size with digit grouping

grouping chunks of digits with commas the standard way makes it easier to tell how large a number is:

1 digit number: 1
2 digits: 22
3 digits: 333
4 digits: 1,333
5 digits: 22,333
6 digits: 333,333
7 digits: 1,333,333
8 digits: 22,333,333
9 digits: 333,333,333
10 digits: 1,333,333,333
11 digits: 22,333,333,333

however, when numbers get even larger, it becomes hard to count the number of groups of 3.  we propose a non-uniform grouping of digits to make counting slightly easier.

the general idea is as follows:

1 + 1 + 1 + 1 + 3 + 3 = 10
10 + 10 + 10 + 10 + 30 + 30 = 100
(1 + 1 + 1 + 1 + 3 + 3) + 10 + 10 + 10 + 30 + 30 = 100

in the third line above, we have substituted the first line into the first "10" in the second line.  this can be continued recursively for larger powers of 10.  (previously, powers of 2.)  groupings of 1, 3, 10, 30, 100, 300, and so forth allow identifying chunks of a power of 10 digits.

here are sample numbers of 1 through 10 digits with inserted commas.  (special cases: optionally omitting commas for numbers of 1 through 4 digits.)

1 digit: 1
2 digits: 1,1 (or 11)
3 digits: 1,1,1 (or 111)
4 digits: 1,1,1,1 (or 1111)
5 digits: 1,1,333
6 digits: 1,1,1,333
7 digits: 1,1,1,1,333
8 digits: 1,1,333,333
9 digits: 1,1,1,333,333
10 digits: 1,1,1,1,333,333

if a number grows or shrinks by one digit, the comma pattern can radically change, as it does between 4 and 5 digits, and between 7 and 8.  this might be confusing compared to the standard system of groups of 3.  but radical change in appearance when a number has changed by a factor of 10 might be beneficial.

(the Indian numbering system (lakh, crore, etc.) has non-uniform digit groupings, though not as extreme as this.)

to handle a number of 10*a + b (a<10) digits, first add commas to the first 10*a digits by itself, then recursively the next b digits, then concatenate.  in other words, treat the length one digit at a time.  in the examples below (and above), for ease of understanding, we also give the number of digits in each digit grouping as the digits of that grouping.

11 digits: 1,1,1,1,333,333,1
12 digits: 1,1,1,1,333,333,1,1
13 digits: 1,1,1,1,333,333,1,1,1
14 digits: 1,1,1,1,333,333,1,1,1,1
15 digits: 1,1,1,1,333,333,1,1,333
16 digits: 1,1,1,1,333,333,1,1,1,333
17 digits: 1,1,1,1,333,333,1,1,1,1,333
18 digits: 1,1,1,1,333,333,1,1,333,333
19 digits: 1,1,1,1,333,333,1,1,1,333,333
20 digits: 1,1,1,1,333,333,1010101010
21 digits: 1,1,1,1,333,333,1010101010,1
22 digits: 1,1,1,1,333,333,1010101010,1,1
23 digits: 1,1,1,1,333,333,1010101010,1,1,1
24 digits: 1,1,1,1,333,333,1010101010,1,1,1,1
25 digits: 1,1,1,1,333,333,1010101010,1,1,333
26 digits: 1,1,1,1,333,333,1010101010,1,1,1,333
27 digits: 1,1,1,1,333,333,1010101010,1,1,1,1,333
28 digits: 1,1,1,1,333,333,1010101010,1,1,333,333
29 digits: 1,1,1,1,333,333,1010101010,1,1,1,333,333
30 digits: 1,1,1,1,333,333,1010101010,1010101010
31 digits: 1,1,1,1,333,333,1010101010,1010101010,1

the length of a number can therefore be read off one digit at a time.  if a digit group size increases, it  increases only by 3 or 10/3 .  the next digit of the length begins when the grouping size decreases to one: ",X,".  this resembles the "ladders" in a previous post about digit sequences.  (originally those digit sequences were developed to serve as sample digit groups for this post, but 333 and 1010101010 etc. ended up being simpler.)

(counterpoint: for just communicating the size of a number, much simpler than the madness proposed here is scientific notation: 120000 = 1.2e5)

below are the sizes of digit groups for numbers whose number of digits is of the form d*10^n .

1 digit: 1
2 digits: 1 1
3 digits: 1 1 1
4 digits: 1 1 1 1
5 digits: 1 1 3
6 digits: 1 1 1 3
7 digits: 1 1 1 1 3
8 digits: 1 1 3 3
9 digits: 1 1 1 3 3
10 digits: 1 1 1 1 3 3
20 digits: 1 1 1 1 3 3 10
30 digits: 1 1 1 1 3 3 10 10
40 digits: 1 1 1 1 3 3 10 10 10
50 digits: 1 1 1 1 3 3 10 30
60 digits: 1 1 1 1 3 3 10 10 30
70 digits: 1 1 1 1 3 3 10 10 10 30
80 digits: 1 1 1 1 3 3 10 30 30
90 digits: 1 1 1 1 3 3 10 10 30 30
100 digits: 1 1 1 1 3 3 10 10 10 30 30
200 digits: 1 1 1 1 3 3 10 10 10 30 30 100
300 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100
400 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 100
500 digits: 1 1 1 1 3 3 10 10 10 30 30 100 300
600 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 300
700 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 100 300
800 digits: 1 1 1 1 3 3 10 10 10 30 30 100 300 300
900 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 300 300
1000 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 100 300 300
2000 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 100 300 300 1000
3000 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 100 300 300 1000 1000
4000 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 100 300 300 1000 1000 1000
5000 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 100 300 300 1000 3000
6000 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 100 300 300 1000 1000 3000
7000 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 100 300 300 1000 1000 1000 3000
8000 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 100 300 300 1000 3000 3000
9000 digits: 1 1 1 1 3 3 10 10 10 30 30 100 100 100 300 300 1000 1000 3000 3000

for example, the digit grouping of a 555-digit number is first the digit grouping of a 500-digit number, 1 1 1 1 3 3 10 10 10 30 30 100 300 , then the digit grouping of a 50-digit number 1 1 1 1 3 3 10 30 , then the digit grouping of a 5 digit number, 1 1 3 , so the entire digit grouping is 1 1 1 1 3 3 10 10 10 30 30 100 300 1 1 1 1 3 3 10 30 1 1 3 .  here is an example 555-digit number with commas so inserted:

1,1,1,1,333,333,1010101010,1010101010,1010101010,303030303030303030303030303030,303030303030303030303030303030,1001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001,300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300300,1,1,1,1,333,333,1010101010,303030303030303030303030303030,1,1,333

here is a sample 105-digit number, illustrating that nothing special happens when the length has an internal zero.  the digit grouping is 1 1 1 1 3 3 10 10 10 30 30 1 1 3:

1,1,1,1,333,333,1010101010,1010101010,1010101010,303030303030303030303030303030,303030303030303030303030303030,1,1,333

because internal digit chunks can get arbitrarily long, this method of grouping is not helpful for providing visual breaks for a human reading or transcribing the digits.  it is not too helpful for locating a particular digit by index.  previously, varied separator characters to solve these problems.

source code in Haskell to generate digit group sizes and perform groupings.

Saturday, May 25, 2024

[djtfvrnt] sigil numbers

IEEE 754 floating point can represent infinities and Not a Number without crashing (in contrast to integers, which cannot represent those):

float infinity = 1/0.0;
float NaN = 0/0.0;
float negative_infinity = -1/0.0;

the denominator of 0.0 not 0 is needed to avoid a compile-time warning (gcc 7.5.0). 1.0/0 and 0.0/0 also cause the warning.

the infinities may be useful for algorithms which require an initialization value larger or smaller than any value that will be seen in the input, for example, finding the maximum of an array.

I can't think of any numerical use case for NaN.  there are apparently many encodings (bit strings) that are NaN, so maybe useful for steganography.

Saturday, May 18, 2024

[xmtxeomc] Gotterdammerung-Ragnarok

the most metal hyphenated name "Götterdämmerung-Ragnarök" has thrëëë umlauts!  quite befitting for the name of the final conflict of the gods.

also possible are the Norse spellings/transcriptions Ragnarøkkr, Ragnarøkr, Ragnarøk, Ragnarǫkkr, Ragnarǫkr, Ragnarǫk (o with an ogonek).

of course, with Unicode combining diacritics, you don't have to choose which diacritic you like best to decorate the o: Ragnarø̨̈k.

Thursday, November 30, 2023

[jdgtipus] base 57

23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz

omissions: capital i and lowercase L look similar in sans serif fonts: Il.  lowercase L and number 1 look similar in serif fonts: l1.  number 0 and capital o look similar in many fonts: 0O.

similar to Bitcoin's base 58: previously (1), (2)

Monday, November 13, 2023

[ijfflotu] RPPFN revisited

for a prime number P, compute the prime factorization of P-1, then recursively repeat with each of those primes.  as part of the Lucas primality test, this recursive factorization serves as a deterministic proof of primality (Pratt certificate).  (each prime also needs a witness, but witnesses are easy to find, e.g., randomly.)

we rewrite the previous compact Recursive Prime Predecessor Factorization Notation into a more conventional form.  although it is generally more verbose, it avoids repeating the definition of common prime factors.  prime factors are defined in order of decreasing size.

the first two examples below are Mersenne primes.

each certificate tells a complicated multilayered story in a language that is mostly incomprehensible.  certain "words", small factors, get used frequently.  in Mersenne primes, the first "sentence", the factorization of the number 2^p-2, often has many prime factors because of algebraic factorization.  perhaps the story of 2^3217-1 can be completed someday.

2^2281 - 1 = p262; p262 = 1 + 2 * p1^2 * p2^2 * p3 * p4 * p5 * p6 * p10 * p12 * p17 * p34 * p38 * p42 * p44 * p51 * p58 * p65 * p70 * p85 * p86 * p98 * p111 * p134 * p141 * p143 * p150 * p156 * p157 * p158 * p159 * p161 * p165 * p178 * p179 * p185 * p187 * p208 * p209 * p216 * p217 * p219 * p220 * p224 * p229 * p234 * p240 * p241 * p242 * p243 * p244 * p245 * p248 * p249 * p254 * p256 * p258 * p261; p261 = 1 + 2^5 * p1 * p2 * p7 * p8 * p12 * p221 * p239 * p259 * p260; p260 = 1 + 2^3 * p3 * p250 * p255; p259 = 1 + 2^8 * p1 * p7 * p24 * p228 * p233 * p252; p258 = 1 + 2^4 * p1 * p2 * p7 * p29 * p38 * p73 * p257; p257 = 1 + 2^5 * p2^2 * p3 * p8 * p74 * p251; p256 = 1 + 2^4 * p1 * p2 * p7 * p253; p255 = 1 + 2 * p8 * p97 * p128 * p162 * p198 * p237; p254 = 1 + 2^7 * p1 * p2 * p7 * p8 * p37 * p247; p253 = 1 + 2^7 * p1 * p2 * p200 * p205 * p236; p252 = 1 + 2^2 * p8 * p26 * p169 * p246; p251 = 1 + 2 * p2 * p4 * p5 * p11 * p223 * p235; p250 = 1 + 2 * p1 * p4 * p6^2 * p8 * p140 * p215 * p218; p249 = 1 + 2^2 * p1 * p2 * p7 * p50 * p183 * p238; p248 = 1 + 2^4 * p1 * p7^2 * p68 * p168 * p201 * p210; p247 = 1 + 2^3 * p1^2 * p3^2 * p47 * p113 * p146 * p175 * p207; p246 = 1 + 2^2 * p1 * p9 * p15 * p46 * p114 * p227; p245 = 1 + 2^3 * p1 * p2 * p7 * p14 * p180 * p225; p244 = 1 + 2^3 * p1 * p2 * p3 * p5 * p7 * p108 * p110 * p139 * p155; p243 = 1 + 2 * p1 * p2 * p7 * p53 * p66 * p191 * p197; p242 = 1 + 2 * p1 * p2 * p7 * p142 * p222; p241 = 1 + 2^5 * p2^2 * p7 * p231; p240 = 1 + 2^2 * p1^2 * p2 * p7 * p104 * p152 * p167; p239 = 1 + 2 * p84 * p230; p238 = 1 + 2^3 * p1^3 * p2 * p164 * p211; p237 = 1 + 2 * p2 * p232; p236 = 1 + 2^4 * p25 * p226; p235 = 1 + 2^2 * p1 * p2 * p188 * p204; p234 = 1 + 2^3 * p1 * p2 * p7 * p166 * p193; p233 = 1 + 2^2 * p12 * p94 * p214; p232 = 1 + 2 * p1 * p11 * p26 * p87 * p199; p231 = 1 + 2 * p2 * p8 * p10 * p117 * p196; p230 = 1 + 2 * p92 * p151 * p170; p229 = 1 + 2^4 * p1 * p6 * p7 * p99 * p181; p228 = 1 + 2 * p1 * p21 * p129 * p190; p227 = 1 + 2 * p8 * p11 * p213; p226 = 1 + 2^2 * p1^3 * p35 * p206; p225 = 1 + 2 * p3 * p149 * p172; p224 = 1 + 2^10 * p1^4 * p7 * p159; p223 = 1 + 2^5 * p33 * p40 * p163; p222 = 1 + 2^2 * p1^2 * p76 * p194; p221 = 1 + 2^3 * p1 * p6 * p29 * p186; p220 = 1 + 2 * p1^2 * p2 * p7 * p203; p219 = 1 + 2^4 * p1 * p5 * p7 * p184; p218 = 1 + 2^2 * p212; p217 = 1 + 2^4 * p1 * p2 * p6 * p7 * p42 * p45; p216 = 1 + 2^6 * p1^3 * p2 * p4 * p7 * p96; p215 = 1 + 2 * p1 * p2^2 * p18 * p171; p214 = 1 + 2^6 * p1 * p6 * p182; p213 = 1 + 2^2 * p1 * p9 * p14 * p147; p212 = 1 + 2 * p1 * p16 * p88 * p90; p211 = 1 + 2 * p1^3 * p5 * p6 * p145; p210 = 1 + 2^4 * p1^2 * p47 * p127; p209 = 1 + 2 * p2^4 * p3 * p7 * p100; p208 = 1 + 2^4 * p1 * p7 * p160; p207 = 1 + 2 * p2 * p202; p206 = 1 + 2 * p1 * p2 * p3 * p174; p205 = 1 + 2^2 * p2 * p10 * p41 * p62; p204 = 1 + 2 * p1 * p32 * p131; p203 = 1 + 2^3 * p192; p202 = 1 + 2^2 * p1 * p7^2 * p12 * p21; p201 = 1 + 2^2 * p3 * p33 * p105; p200 = 1 + 2 * p1 * p189; p199 = 1 + 2 * p1 * p3^2 * p133; p198 = 1 + 2^3 * p2 * p6 * p121; p197 = 1 + 2 * p195; p196 = 1 + 2^3 * p176; p195 = 1 + 2^2 * p3 * p153; p194 = 1 + 2 * p1 * p177; p193 = 1 + 2^2 * p1 * p53 * p63; p192 = 1 + 2^6 * p4 * p14 * p18; p191 = 1 + 2 * p41 * p112; p190 = 1 + 2 * p1 * p2 * p144; p189 = 1 + 2^3 * p1^2 * p2^2 * p78; p188 = 1 + 2 * p50 * p93; p187 = 1 + 2 * p1 * p7 * p123; p186 = 1 + 2 * p67 * p75; p185 = 1 + 2 * p1 * p2 * p7 * p91; p184 = 1 + 2 * p1 * p154; p183 = 1 + 2 * p173; p182 = 1 + 2 * p3 * p34 * p52; p181 = 1 + 2^3 * p148; p180 = 1 + 2 * p3 * p5 * p8 * p29; p179 = 1 + 2^10 * p1^3 * p7; p178 = 1 + 2 * p1^3 * p3 * p7 * p20; p177 = 1 + 2 * p1^3 * p2 * p9 * p15; p176 = 1 + 2^4 * p10 * p72; p175 = 1 + 2^3 * p7 * p101; p174 = 1 + 2^3 * p1^2 * p2 * p81; p173 = 1 + 2^5 * p124; p172 = 1 + 2^3 * p1^4 * p5 * p13; p171 = 1 + 2^2 * p1 * p132; p170 = 1 + 2 * p3 * p5 * p6 * p23; p169 = 1 + 2 * p1 * p138; p168 = 1 + 2^2 * p1 * p3 * p106; p167 = 1 + 2^2 * p1 * p2 * p109; p166 = 1 + 2^2 * p1^2 * p5 * p7 * p9; p165 = 1 + 2^2 * p1 * p2 * p3 * p7 * p10; p164 = 1 + 2 * p1^2 * p5 * p77; p163 = 1 + 2^3 * p1 * p120; p162 = 1 + 2^2 * p2 * p12 * p44; p161 = 1 + 2^2 * p1 * p2 * p7 * p36; p160 = 1 + 2^2 * p137; p159 = 1 + 2 * p1^2 * p3 * p7 * p20; p158 = 1 + 2^3 * p1 * p7 * p52; p157 = 1 + 2^5 * p2 * p3^2 * p7; p156 = 1 + 2^2 * p1 * p2^2 * p7 * p8; p155 = 1 + 2^3 * p16 * p47; p154 = 1 + 2 * p2 * p125; p153 = 1 + 2^2 * p1^3 * p2 * p4 * p6; p152 = 1 + 2^3 * p1^2 * p3 * p40; p151 = 1 + 2^2 * p1^2 * p102; p150 = 1 + 2^4 * p1^3 * p4 * p7; p149 = 1 + 2 * p7 * p99; p148 = 1 + 2 * p8 * p89; p147 = 1 + 2 * p1 * p126; p146 = 1 + 2 * p136; p145 = 1 + 2 * p135; p144 = 1 + 2 * p1 * p122; p143 = 1 + 2^4 * p1 * p2 * p45; p142 = 1 + 2^2 * p5 * p83; p141 = 1 + 2^6 * p1^2 * p2 * p7; p140 = 1 + 2^2 * p10 * p57; p139 = 1 + 2 * p7^2 * p19; p138 = 1 + 2^3 * p115; p137 = 1 + 2 * p1 * p118; p136 = 1 + 2 * p130; p135 = 1 + 2 * p7 * p79; p134 = 1 + 2^3 * p1 * p7 * p19; p133 = 1 + 2^2 * p116; p132 = 1 + 2 * p1^2 * p3^2 * p9; p131 = 1 + 2^2 * p1 * p95; p130 = 1 + 2 * p2 * p5 * p35; p129 = 1 + 2 * p1 * p5^2 * p6; p128 = 1 + 2^2 * p17 * p18; p127 = 1 + 2 * p119; p126 = 1 + 2^2 * p107; p125 = 1 + 2 * p1 * p9 * p20; p124 = 1 + 2^3 * p2^2 * p16; p123 = 1 + 2 * p1^3 * p39; p122 = 1 + 2 * p2 * p80; p121 = 1 + 2 * p7 * p45; p120 = 1 + 2 * p1 * p6 * p22; p119 = 1 + 2 * p2 * p71; p118 = 1 + 2 * p2 * p69; p117 = 1 + 2^2 * p1 * p64; p116 = 1 + 2 * p1 * p82; p115 = 1 + 2 * p103; p114 = 1 + 2^2 * p1 * p59; p113 = 1 + 2 * p2 * p5 * p13; p112 = 1 + 2^2 * p1 * p55; p111 = 1 + 2^4 * p1 * p2 * p7; p110 = 1 + 2 * p1^2 * p5 * p7; p109 = 1 + 2^2 * p2 * p5 * p6; p108 = 1 + 2^3 * p2 * p23; p107 = 1 + 2 * p1 * p4 * p15; p106 = 1 + 2 * p1 * p7 * p9; p105 = 1 + 2^2 * p2 * p3 * p8; p104 = 1 + 2^5 * p2 * p7; p103 = 1 + 2^3 * p3 * p15; p102 = 1 + 2^6 * p13; p101 = 1 + 2 * p10 * p12; p100 = 1 + 2 * p2 * p4 * p8; p99 = 1 + 2^2 * p66; p98 = 1 + 2^3 * p1 * p2 * p7; p97 = 1 + 2 * p1 * p54; p96 = 1 + 2^2 * p3 * p21; p95 = 1 + 2 * p1 * p2 * p18; p94 = 1 + 2 * p3 * p4 * p5; p93 = 1 + 2 * p1 * p51; p92 = 1 + 2 * p1 * p2^2 * p5; p91 = 1 + 2^2 * p1 * p3 * p8; p90 = 1 + 2 * p1 * p49; p89 = 1 + 2^2 * p1 * p2 * p10; p88 = 1 + 2^2 * p1 * p33; p87 = 1 + 2 * p1 * p2 * p3^2; p86 = 1 + 2^3 * p1 * p2 * p4; p85 = 1 + 2^6 * p7; p84 = 1 + 2 * p1^2 * p2 * p5; p83 = 1 + 2^7 * p1^2; p82 = 1 + 2 * p2 * p27; p81 = 1 + 2 * p1 * p2^2 * p3; p80 = 1 + 2 * p1 * p37; p79 = 1 + 2 * p61; p78 = 1 + 2^2 * p4 * p8; p77 = 1 + 2^4 * p1^2 * p3; p76 = 1 + 2 * p60; p75 = 1 + 2 * p2 * p3 * p5; p74 = 1 + 2 * p56; p73 = 1 + 2^2 * p1^2 * p8; p72 = 1 + 2 * p1 * p31; p71 = 1 + 2 * p1^4 * p2; p70 = 1 + 2^3 * p2 * p7; p69 = 1 + 2^2 * p1 * p17; p68 = 1 + 2^2 * p1 * p16; p67 = 1 + 2^2 * p1^2 * p6; p66 = 1 + 2^6 * p1^2; p65 = 1 + 2 * p1 * p2 * p7; p64 = 1 + 2^3 * p19; p63 = 1 + 2 * p48; p62 = 1 + 2 * p1^2 * p9; p61 = 1 + 2^2 * p29; p60 = 1 + 2 * p2 * p3^2; p59 = 1 + 2 * p43; p58 = 1 + 2^3 * p1 * p7; p57 = 1 + 2^4 * p1^3; p56 = 1 + 2 * p4 * p7; p55 = 1 + 2^4 * p2^2; p54 = 1 + 2^2 * p1 * p10; p53 = 1 + 2 * p1 * p17; p52 = 1 + 2^5 * p4; p51 = 1 + 2 * p1 * p2 * p4; p50 = 1 + 2^2 * p21; p49 = 1 + 2 * p2 * p10; p48 = 1 + 2^3 * p2 * p3; p47 = 1 + 2 * p1^3 * p2; p46 = 1 + 2 * p30; p45 = 1 + 2^8; p44 = 1 + 2^4 * p1 * p2; p43 = 1 + 2 * p3 * p6; p42 = 1 + 2^2 * p1 * p7; p41 = 1 + 2 * p28; p40 = 1 + 2 * p1^2 * p4; p39 = 1 + 2^2 * p3^2; p38 = 1 + 2 * p2 * p7; p37 = 1 + 2^2 * p13; p36 = 1 + 2 * p1^4; p35 = 1 + 2^2 * p1 * p5; p34 = 1 + 2 * p1 * p2^2; p33 = 1 + 2^2 * p11; p32 = 1 + 2 * p1 * p8; p31 = 1 + 2^3 * p6; p30 = 1 + 2 * p2 * p5; p29 = 1 + 2 * p1^2 * p3; p28 = 1 + 2^4 * p3; p27 = 1 + 2^2 * p1^3; p26 = 1 + 2 * p15; p25 = 1 + 2 * p1 * p6; p24 = 1 + 2^2 * p2^2; p23 = 1 + 2^5 * p1; p22 = 1 + 2 * p12; p21 = 1 + 2 * p1 * p5; p20 = 1 + 2^3 * p1^2; p19 = 1 + 2 * p2 * p3; p18 = 1 + 2 * p1 * p4; p17 = 1 + 2^2 * p1 * p2; p16 = 1 + 2 * p9; p15 = 1 + 2^2 * p5; p14 = 1 + 2 * p8; p13 = 1 + 2 * p1 * p3; p12 = 1 + 2^3 * p2; p11 = 1 + 2^2 * p1^2; p10 = 1 + 2 * p1 * p2; p9 = 1 + 2^2 * p3; p8 = 1 + 2 * p4; p7 = 1 + 2 * p1^2; p6 = 1 + 2^4; p5 = 1 + 2^2 * p1; p4 = 1 + 2 * p2; p3 = 1 + 2 * p1; p2 = 1 + 2^2; p1 = 1 + 2.


2^2203 - 1 = p264; p264 = 1 + 2 * p1^2 * p3 * p90 * p127 * p132 * p136 * p152 * p187 * p221 * p222 * p232 * p235 * p244 * p246 * p251 * p253 * p256 * p258 * p261 * p263; p263 = 1 + 2 * p1 * p18 * p39 * p51 * p67 * p81 * p262; p262 = 1 + 2^5 * p1 * p9 * p15 * p58 * p76 * p146 * p171 * p248 * p259; p261 = 1 + 2^3 * p1^3 * p51 * p72 * p93 * p260; p260 = 1 + 2 * p1 * p3 * p10 * p15 * p27 * p41 * p234 * p254 * p257; p259 = 1 + 2 * p1 * p66 * p149 * p210 * p250 * p255; p258 = 1 + 2^6 * p1 * p2^3 * p51 * p96 * p162 * p241 * p243; p257 = 1 + 2^2 * p3^3 * p54 * p216 * p230 * p242; p256 = 1 + 2^3 * p2 * p6 * p51 * p225 * p252; p255 = 1 + 2^5 * p3^2 * p4 * p25 * p185 * p211 * p236; p254 = 1 + 2^2 * p3 * p32 * p223 * p239; p253 = 1 + 2 * p1 * p11 * p51 * p247; p252 = 1 + 2 * p3 * p14 * p249; p251 = 1 + 2 * p2 * p3 * p7 * p51 * p112 * p237; p250 = 1 + 2 * p1 * p2 * p219 * p231; p249 = 1 + 2^3 * p1 * p2 * p245; p248 = 1 + 2 * p4 * p14 * p150 * p164 * p197 * p206; p247 = 1 + 2^2 * p4 * p192 * p208 * p213; p246 = 1 + 2 * p1 * p11 * p51 * p205 * p226; p245 = 1 + 2^2 * p3 * p143 * p238; p244 = 1 + 2^8 * p1^3 * p2^2 * p51 * p79 * p176 * p214; p243 = 1 + 2^2 * p1 * p6 * p27 * p49 * p87 * p198 * p209; p242 = 1 + 2^3 * p1 * p121 * p140 * p145 * p165 * p180; p241 = 1 + 2 * p1 * p2 * p240; p240 = 1 + 2 * p1 * p13 * p18 * p137 * p228; p239 = 1 + 2 * p1^4 * p2 * p80 * p200 * p202; p238 = 1 + 2 * p1 * p2 * p30 * p161 * p167 * p204; p237 = 1 + 2^4 * p1^2 * p3 * p110 * p229; p236 = 1 + 2 * p55 * p233; p235 = 1 + 2 * p1 * p17 * p20 * p51 * p218; p234 = 1 + 2^2 * p2^3 * p116 * p220; p233 = 1 + 2^2 * p2 * p19 * p97 * p217; p232 = 1 + 2 * p1 * p51 * p105 * p215; p231 = 1 + 2^6 * p224; p230 = 1 + 2^2 * p1 * p103 * p122 * p188; p229 = 1 + 2^3 * p7 * p133 * p207; p228 = 1 + 2 * p227; p227 = 1 + 2^4 * p8 * p10 * p108 * p189; p226 = 1 + 2 * p77 * p168 * p177; p225 = 1 + 2 * p1 * p4 * p5 * p172 * p174; p224 = 1 + 2^3 * p1^3 * p4 * p19 * p46 * p183; p223 = 1 + 2 * p1^2 * p15 * p212; p222 = 1 + 2^3 * p5 * p20 * p50 * p51 * p159; p221 = 1 + 2^3 * p1 * p7 * p51 * p125 * p142; p220 = 1 + 2^3 * p1^2 * p70 * p201; p219 = 1 + 2^4 * p1 * p2 * p22 * p113 * p169; p218 = 1 + 2 * p1 * p18 * p163 * p166; p217 = 1 + 2 * p1 * p156 * p184; p216 = 1 + 2 * p1^2 * p155 * p179; p215 = 1 + 2^2 * p5 * p11 * p199; p214 = 1 + 2^3 * p1 * p3 * p22 * p34 * p52 * p94; p213 = 1 + 2^3 * p1 * p3 * p6 * p22 * p53 * p92; p212 = 1 + 2^2 * p14 * p27 * p62 * p129; p211 = 1 + 2 * p1^4 * p3 * p5^2 * p7 * p29 * p36; p210 = 1 + 2^2 * p1 * p139 * p153; p209 = 1 + 2 * p1^3 * p193; p208 = 1 + 2^2 * p7 * p15 * p29 * p134; p207 = 1 + 2 * p1 * p2 * p196; p206 = 1 + 2 * p6 * p194; p205 = 1 + 2^3 * p17 * p81 * p117; p204 = 1 + 2 * p203; p203 = 1 + 2^2 * p2 * p191; p202 = 1 + 2^2 * p1 * p78 * p157; p201 = 1 + 2 * p1^2 * p190; p200 = 1 + 2^2 * p1^3 * p181; p199 = 1 + 2 * p1^3 * p5 * p7 * p154; p198 = 1 + 2^2 * p195; p197 = 1 + 2^2 * p1 * p4 * p15 * p148; p196 = 1 + 2 * p120 * p131; p195 = 1 + 2^2 * p1^2 * p89 * p101; p194 = 1 + 2^3 * p1 * p7 * p11 * p126; p193 = 1 + 2 * p1 * p5 * p41 * p123; p192 = 1 + 2 * p1 * p6 * p16 * p138; p191 = 1 + 2 * p2 * p72 * p124; p190 = 1 + 2 * p186; p189 = 1 + 2^2 * p1^2 * p3^2 * p16 * p65; p188 = 1 + 2^2 * p1 * p2 * p3 * p158; p187 = 1 + 2^6 * p1^2 * p2 * p3^2 * p51; p186 = 1 + 2 * p182; p185 = 1 + 2 * p1^2 * p173; p184 = 1 + 2 * p3^3 * p141; p183 = 1 + 2 * p1 * p178; p182 = 1 + 2 * p2 * p175; p181 = 1 + 2 * p2 * p6 * p147; p180 = 1 + 2 * p1 * p57 * p104; p179 = 1 + 2 * p8 * p13 * p95; p178 = 1 + 2 * p2 * p4^2 * p96; p177 = 1 + 2^3 * p1^2 * p144; p176 = 1 + 2^2 * p170; p175 = 1 + 2^5 * p1 * p9 * p71; p174 = 1 + 2 * p1^2 * p2 * p9 * p68; p173 = 1 + 2 * p1^2 * p151; p172 = 1 + 2^2 * p1^2 * p135; p171 = 1 + 2^2 * p20 * p91; p170 = 1 + 2^2 * p1 * p31 * p45; p169 = 1 + 2^3 * p3 * p118; p168 = 1 + 2 * p160; p167 = 1 + 2^3 * p2^2 * p86; p166 = 1 + 2^4 * p1 * p114; p165 = 1 + 2^4 * p130; p164 = 1 + 2^3 * p1 * p5 * p72; p163 = 1 + 2 * p30 * p73; p162 = 1 + 2^2 * p2 * p3 * p82; p161 = 1 + 2 * p37 * p60; p160 = 1 + 2 * p8 * p102; p159 = 1 + 2 * p1 * p2 * p107; p158 = 1 + 2^2 * p1 * p8 * p61; p157 = 1 + 2^2 * p1^2 * p99; p156 = 1 + 2^2 * p1^2 * p98; p155 = 1 + 2^5 * p2 * p4 * p15; p154 = 1 + 2 * p1 * p128; p153 = 1 + 2 * p14 * p74; p152 = 1 + 2^3 * p1^3 * p51; p151 = 1 + 2^2 * p1 * p8 * p44; p150 = 1 + 2^2 * p1 * p3 * p7 * p14; p149 = 1 + 2 * p1 * p3 * p11 * p14; p148 = 1 + 2^3 * p1 * p2 * p63; p147 = 1 + 2 * p2 * p17 * p28; p146 = 1 + 2 * p1^3 * p4 * p27; p145 = 1 + 2^3 * p1^2 * p4 * p17; p144 = 1 + 2^2 * p3 * p4 * p33; p143 = 1 + 2 * p1 * p3 * p8 * p12; p142 = 1 + 2 * p1^2 * p2 * p56; p141 = 1 + 2 * p25 * p38; p140 = 1 + 2^2 * p119; p139 = 1 + 2^2 * p11 * p42; p138 = 1 + 2 * p1 * p111; p137 = 1 + 2^3 * p100; p136 = 1 + 2 * p1 * p5 * p51; p135 = 1 + 2^4 * p1^3 * p2 * p4; p134 = 1 + 2^2 * p1 * p88; p133 = 1 + 2^2 * p2^2 * p40; p132 = 1 + 2 * p1^3 * p51; p131 = 1 + 2^2 * p1 * p84; p130 = 1 + 2^2 * p1 * p83; p129 = 1 + 2^2 * p1 * p2^2 * p15; p128 = 1 + 2 * p115; p127 = 1 + 2 * p6 * p51; p126 = 1 + 2 * p1 * p2 * p3 * p16; p125 = 1 + 2^2 * p2 * p64; p124 = 1 + 2 * p1 * p7 * p26; p123 = 1 + 2^2 * p9 * p25; p122 = 1 + 2^2 * p2 * p3^2 * p4; p121 = 1 + 2 * p109; p120 = 1 + 2 * p106; p119 = 1 + 2^5 * p1 * p3 * p5; p118 = 1 + 2 * p5 * p47; p117 = 1 + 2 * p1 * p3 * p38; p116 = 1 + 2^2 * p3^2 * p11; p115 = 1 + 2 * p2 * p3 * p26; p114 = 1 + 2^2 * p1^2 * p2 * p11; p113 = 1 + 2 * p1^2 * p48; p112 = 1 + 2 * p1 * p75; p111 = 1 + 2 * p2 * p5 * p13; p110 = 1 + 2 * p1^5 * p4; p109 = 1 + 2^2 * p10 * p13; p108 = 1 + 2^2 * p4 * p29; p107 = 1 + 2^2 * p1 * p3 * p16; p106 = 1 + 2^2 * p3 * p5^2; p105 = 1 + 2^2 * p1 * p2 * p19; p104 = 1 + 2 * p1 * p7 * p11; p103 = 1 + 2^3 * p1 * p2^2 * p3; p102 = 1 + 2^2 * p1^2 * p27; p101 = 1 + 2 * p1 * p3 * p23; p100 = 1 + 2 * p4 * p5^2; p99 = 1 + 2 * p1^3 * p2 * p5; p98 = 1 + 2 * p85; p97 = 1 + 2^3 * p1^2 * p12; p96 = 1 + 2 * p1 * p59; p95 = 1 + 2^2 * p1 * p43; p94 = 1 + 2^5 * p22; p93 = 1 + 2 * p1^2 * p32; p92 = 1 + 2 * p4 * p28; p91 = 1 + 2 * p1 * p2 * p3 * p4; p90 = 1 + 2 * p1 * p51; p89 = 1 + 2^3 * p1 * p23; p88 = 1 + 2 * p2 * p4 * p6; p87 = 1 + 2^3 * p1^2 * p8; p86 = 1 + 2 * p73; p85 = 1 + 2^6 * p2^2; p84 = 1 + 2 * p1^2 * p21; p83 = 1 + 2^2 * p1 * p2 * p8; p82 = 1 + 2 * p69; p81 = 1 + 2 * p6 * p11; p80 = 1 + 2^2 * p1 * p25; p79 = 1 + 2 * p3 * p22; p78 = 1 + 2^2 * p1 * p22; p77 = 1 + 2 * p1^2 * p2 * p4; p76 = 1 + 2 * p4 * p13; p75 = 1 + 2^3 * p1^2 * p5; p74 = 1 + 2 * p1^2 * p3^2; p73 = 1 + 2^3 * p25; p72 = 1 + 2^2 * p1 * p16; p71 = 1 + 2^5 * p1 * p3; p70 = 1 + 2 * p3 * p14; p69 = 1 + 2^2 * p35; p68 = 1 + 2 * p1 * p27; p67 = 1 + 2^3 * p3 * p4; p66 = 1 + 2^2 * p1^2 * p6; p65 = 1 + 2^3 * p1 * p2^2; p64 = 1 + 2 * p5 * p8; p63 = 1 + 2^4 * p11; p62 = 1 + 2^2 * p1^3 * p2; p61 = 1 + 2 * p1^2 * p9; p60 = 1 + 2 * p1 * p22; p59 = 1 + 2 * p43; p58 = 1 + 2 * p5 * p6; p57 = 1 + 2 * p1 * p20; p56 = 1 + 2^4 * p1^3; p55 = 1 + 2^3 * p1 * p6; p54 = 1 + 2^2 * p1^2 * p4; p53 = 1 + 2^2 * p24; p52 = 1 + 2 * p1^3 * p3; p51 = 1 + 2 * p1 * p17; p50 = 1 + 2^5 * p4; p49 = 1 + 2^2 * p1 * p9; p48 = 1 + 2^4 * p1 * p3; p47 = 1 + 2^2 * p21; p46 = 1 + 2^3 * p1 * p5; p45 = 1 + 2^2 * p20; p44 = 1 + 2^3 * p2 * p3; p43 = 1 + 2^3 * p9; p42 = 1 + 2^2 * p1 * p7; p41 = 1 + 2 * p1 * p11; p40 = 1 + 2 * p1 * p2 * p3; p39 = 1 + 2 * p1^2 * p4; p38 = 1 + 2^2 * p1^2 * p2; p37 = 1 + 2 * p23; p36 = 1 + 2^2 * p13; p35 = 1 + 2 * p1^4; p34 = 1 + 2 * p1 * p2^2; p33 = 1 + 2^2 * p11; p32 = 1 + 2 * p1 * p8; p31 = 1 + 2^3 * p6; p30 = 1 + 2 * p1^2 * p3; p29 = 1 + 2^4 * p3; p28 = 1 + 2^2 * p1^3; p27 = 1 + 2 * p15; p26 = 1 + 2 * p1 * p6; p25 = 1 + 2^2 * p2^2; p24 = 1 + 2^5 * p1; p23 = 1 + 2^3 * p4; p22 = 1 + 2 * p12; p21 = 1 + 2 * p1 * p5; p20 = 1 + 2^3 * p1^2; p19 = 1 + 2 * p2 * p3; p18 = 1 + 2 * p1 * p4; p17 = 1 + 2^2 * p1 * p2; p16 = 1 + 2 * p9; p15 = 1 + 2^2 * p5; p14 = 1 + 2 * p8; p13 = 1 + 2 * p1 * p3; p12 = 1 + 2^3 * p2; p11 = 1 + 2^2 * p1^2; p10 = 1 + 2 * p1 * p2; p9 = 1 + 2^2 * p3; p8 = 1 + 2 * p4; p7 = 1 + 2 * p1^2; p6 = 1 + 2^4; p5 = 1 + 2^2 * p1; p4 = 1 + 2 * p2; p3 = 1 + 2 * p1; p2 = 1 + 2^2; p1 = 1 + 2.


factorization of the 10th Fermat number.  the large powers of 2 always present in Fermat number factorizations are less obvious in this notation compared to RPPFN.

2^1024 + 1 = p107 * p116 * p140 * p144; p144 = 1 + 2^13 * p1 * p5 * p8 * p9 * p64 * p112 * p137 * p141 * p142 * p143; p143 = 1 + 2 * p2 * p127 * p132 * p134 * p136; p142 = 1 + 2^2 * p3^2 * p5 * p56 * p126 * p139; p141 = 1 + 2^2 * p105 * p138; p140 = 1 + 2^12 * p1 * p63 * p66 * p96 * p130; p139 = 1 + 2^10 * p113 * p131; p138 = 1 + 2 * p5 * p95 * p121 * p125; p137 = 1 + 2^2 * p3 * p51 * p135; p136 = 1 + 2^2 * p1 * p69 * p97 * p129; p135 = 1 + 2^5 * p1 * p9 * p133; p134 = 1 + 2 * p46 * p118 * p122; p133 = 1 + 2^2 * p1^3 * p5 * p18 * p128; p132 = 1 + 2^3 * p1^2 * p52 * p109 * p119; p131 = 1 + 2 * p1 * p3 * p31 * p114 * p115; p130 = 1 + 2 * p59 * p75 * p82 * p117; p129 = 1 + 2^2 * p2 * p103 * p124; p128 = 1 + 2 * p1^3 * p3 * p45 * p58 * p92 * p94; p127 = 1 + 2^2 * p2 * p3^2 * p5 * p123; p126 = 1 + 2 * p10 * p102 * p108; p125 = 1 + 2^5 * p1 * p2 * p10 * p26 * p70 * p84; p124 = 1 + 2^3 * p1 * p2 * p7 * p42 * p61 * p67; p123 = 1 + 2 * p2 * p13 * p120; p122 = 1 + 2^4 * p2 * p5 * p14 * p27 * p99; p121 = 1 + 2^3 * p2 * p11 * p19 * p98; p120 = 1 + 2^5 * p2 * p110; p119 = 1 + 2^3 * p1 * p3 * p53 * p89; p118 = 1 + 2^2 * p1 * p5 * p7 * p104; p117 = 1 + 2^5 * p1^2 * p4 * p11 * p88; p116 = 1 + 2^14 * p1^2 * p9 * p11 * p12; p115 = 1 + 2 * p1 * p111; p114 = 1 + 2^3 * p1 * p3 * p48 * p74; p113 = 1 + 2^3 * p1^2 * p20 * p34 * p40; p112 = 1 + 2^2 * p1^3 * p44 * p68; p111 = 1 + 2 * p55 * p91; p110 = 1 + 2^3 * p1 * p4 * p101; p109 = 1 + 2 * p3 * p14 * p23 * p49; p108 = 1 + 2 * p106; p107 = 1 + 2^12 * p71; p106 = 1 + 2 * p24 * p93; p105 = 1 + 2^2 * p2 * p3 * p87; p104 = 1 + 2 * p1 * p100; p103 = 1 + 2^2 * p11 * p72; p102 = 1 + 2 * p1^2 * p2^2 * p14^2; p101 = 1 + 2^2 * p1 * p6 * p62; p100 = 1 + 2 * p1^2 * p2^2 * p54; p99 = 1 + 2 * p1 * p5 * p73; p98 = 1 + 2 * p2^2 * p6 * p9^2; p97 = 1 + 2 * p1 * p90; p96 = 1 + 2 * p1^2 * p78; p95 = 1 + 2 * p1 * p81; p94 = 1 + 2^3 * p1 * p65; p93 = 1 + 2 * p2 * p9 * p37; p92 = 1 + 2 * p86; p91 = 1 + 2 * p85; p90 = 1 + 2^5 * p1 * p2 * p30; p89 = 1 + 2 * p1^5 * p28; p88 = 1 + 2 * p83; p87 = 1 + 2^2 * p8 * p38; p86 = 1 + 2 * p80; p85 = 1 + 2 * p79; p84 = 1 + 2 * p77; p83 = 1 + 2 * p2 * p60; p82 = 1 + 2^2 * p1 * p2 * p3 * p17; p81 = 1 + 2 * p76; p80 = 1 + 2^2 * p8 * p32; p79 = 1 + 2^3 * p2 * p39; p78 = 1 + 2 * p1 * p2 * p4 * p17; p77 = 1 + 2 * p5 * p41; p76 = 1 + 2^7 * p3 * p6; p75 = 1 + 2^5 * p2 * p18; p74 = 1 + 2^2 * p1 * p2 * p4 * p7; p73 = 1 + 2 * p1 * p2 * p35; p72 = 1 + 2 * p1^3 * p4 * p7; p71 = 1 + 2 * p1 * p2 * p3 * p13; p70 = 1 + 2 * p1 * p2^2 * p16; p69 = 1 + 2 * p1^3 * p5^2; p68 = 1 + 2^6 * p3 * p7; p67 = 1 + 2 * p1 * p6 * p19; p66 = 1 + 2 * p2 * p43; p65 = 1 + 2 * p1 * p47; p64 = 1 + 2^3 * p3 * p25; p63 = 1 + 2 * p57; p62 = 1 + 2^2 * p1 * p35; p61 = 1 + 2^2 * p1 * p2 * p16; p60 = 1 + 2^2 * p1 * p33; p59 = 1 + 2 * p1^3 * p14; p58 = 1 + 2 * p5 * p25; p57 = 1 + 2 * p50; p56 = 1 + 2 * p1 * p2 * p18; p55 = 1 + 2^2 * p1^4 * p3; p54 = 1 + 2^2 * p1^3 * p7; p53 = 1 + 2^2 * p36; p52 = 1 + 2^4 * p20; p51 = 1 + 2 * p1^6; p50 = 1 + 2^7 * p4; p49 = 1 + 2 * p40; p48 = 1 + 2^2 * p1 * p22; p47 = 1 + 2^4 * p1 * p2^2; p46 = 1 + 2^2 * p1 * p2 * p6; p45 = 1 + 2 * p1^2 * p3^2; p44 = 1 + 2 * p3 * p14; p43 = 1 + 2 * p1 * p26; p42 = 1 + 2^2 * p2^2 * p3; p41 = 1 + 2 * p6 * p7; p40 = 1 + 2^7 * p2; p39 = 1 + 2 * p1 * p21; p38 = 1 + 2 * p5 * p8; p37 = 1 + 2^2 * p2 * p8; p36 = 1 + 2^3 * p1 * p6; p35 = 1 + 2 * p29; p34 = 1 + 2^2 * p18; p33 = 1 + 2 * p1^3 * p2; p32 = 1 + 2^2 * p15; p31 = 1 + 2 * p1 * p2 * p3; p30 = 1 + 2^2 * p3^2; p29 = 1 + 2 * p2 * p7; p28 = 1 + 2 * p1 * p2^2; p27 = 1 + 2 * p1 * p8; p26 = 1 + 2^3 * p6; p25 = 1 + 2^4 * p3; p24 = 1 + 2^2 * p1^3; p23 = 1 + 2 * p13; p22 = 1 + 2 * p1 * p6; p21 = 1 + 2^2 * p2^2; p20 = 1 + 2^5 * p1; p19 = 1 + 2 * p12; p18 = 1 + 2 * p1 * p5; p17 = 1 + 2^3 * p1^2; p16 = 1 + 2 * p2 * p3; p15 = 1 + 2 * p1 * p4; p14 = 1 + 2 * p9; p13 = 1 + 2^2 * p5; p12 = 1 + 2^3 * p2; p11 = 1 + 2^2 * p1^2; p10 = 1 + 2 * p1 * p2; p9 = 1 + 2^2 * p3; p8 = 1 + 2 * p4; p7 = 1 + 2 * p1^2; p6 = 1 + 2^4; p5 = 1 + 2^2 * p1; p4 = 1 + 2 * p2; p3 = 1 + 2 * p1; p2 = 1 + 2^2; p1 = 1 + 2.


10th number of the Sylvester's sequence.

sylvester[10] = 27392450308603031423410234291674686281194364367580914627947367941608692026226993634332118404582438634929548737283992369758487974306317730580753883429460344956410077034761330476016739454649828385541500213920807 = p53 * p78 * p111 * p115; p115 = 1 + 2^2 * p1 * p9 * p71 * p102 * p110 * p114; p114 = 1 + 2 * p1^3 * p4 * p97 * p103 * p113; p113 = 1 + 2 * p1 * p65 * p83 * p112; p112 = 1 + 2 * p1^2 * p3 * p38 * p93 * p101 * p107; p111 = 1 + 2 * p1 * p58 * p82 * p95 * p108; p110 = 1 + 2 * p3 * p10 * p67 * p109; p109 = 1 + 2 * p1 * p64 * p106; p108 = 1 + 2 * p1 * p15 * p45 * p89 * p90; p107 = 1 + 2^5 * p23 * p105; p106 = 1 + 2 * p1 * p12 * p104; p105 = 1 + 2^7 * p2 * p12 * p26 * p61 * p88; p104 = 1 + 2 * p2 * p16 * p100; p103 = 1 + 2 * p1 * p43 * p99; p102 = 1 + 2 * p2 * p4 * p17 * p29 * p63 * p85; p101 = 1 + 2^6 * p24 * p98; p100 = 1 + 2 * p2 * p18 * p52 * p92; p99 = 1 + 2 * p1 * p3 * p28 * p69 * p74; p98 = 1 + 2^4 * p1^2 * p73 * p77; p97 = 1 + 2 * p96; p96 = 1 + 2^2 * p94; p95 = 1 + 2^2 * p3 * p34 * p81; p94 = 1 + 2 * p1 * p3 * p91; p93 = 1 + 2 * p2 * p3 * p4 * p84; p92 = 1 + 2^4 * p1 * p2^2 * p4 * p68; p91 = 1 + 2 * p2 * p87; p90 = 1 + 2^4 * p86; p89 = 1 + 2^3 * p1^2 * p3 * p42 * p48; p88 = 1 + 2 * p1^2 * p80; p87 = 1 + 2^7 * p1 * p70; p86 = 1 + 2 * p1 * p2 * p5 * p30 * p40; p85 = 1 + 2 * p27 * p66; p84 = 1 + 2^2 * p79; p83 = 1 + 2 * p4 * p17 * p57; p82 = 1 + 2 * p49 * p51; p81 = 1 + 2 * p3 * p6 * p62; p80 = 1 + 2^2 * p1 * p31 * p50; p79 = 1 + 2 * p1 * p76; p78 = 1 + 2 * p1 * p75; p77 = 1 + 2^2 * p9 * p18 * p19; p76 = 1 + 2^4 * p26 * p33; p75 = 1 + 2 * p1 * p2 * p60; p74 = 1 + 2 * p72; p73 = 1 + 2^2 * p8 * p55; p72 = 1 + 2 * p35 * p39; p71 = 1 + 2 * p8 * p54; p70 = 1 + 2^2 * p11 * p47; p69 = 1 + 2 * p2 * p3^2 * p4 * p6; p68 = 1 + 2^2 * p1 * p2 * p3 * p32; p67 = 1 + 2^16; p66 = 1 + 2 * p1 * p59; p65 = 1 + 2^2 * p2 * p8 * p22; p64 = 1 + 2 * p1^3 * p44; p63 = 1 + 2^8 * p3 * p5; p62 = 1 + 2^5 * p1^2 * p14; p61 = 1 + 2^2 * p56; p60 = 1 + 2 * p1^2 * p46; p59 = 1 + 2^2 * p1^4 * p9; p58 = 1 + 2^2 * p1 * p41; p57 = 1 + 2^3 * p1^2 * p3^2; p56 = 1 + 2^2 * p1 * p36; p55 = 1 + 2^2 * p2 * p4 * p5; p54 = 1 + 2^3 * p1 * p25; p53 = 1 + 2 * p1^2 * p26; p52 = 1 + 2 * p1^3 * p11; p51 = 1 + 2^4 * p22; p50 = 1 + 2 * p1^2 * p19; p49 = 1 + 2^7 * p1^2; p48 = 1 + 2^2 * p1^2 * p8; p47 = 1 + 2^2 * p1 * p16; p46 = 1 + 2^2 * p2^2 * p3; p45 = 1 + 2^2 * p1^2 * p6; p44 = 1 + 2 * p37; p43 = 1 + 2 * p1 * p21; p42 = 1 + 2 * p2 * p13; p41 = 1 + 2 * p1^3 * p3; p40 = 1 + 2^2 * p1 * p10; p39 = 1 + 2^4 * p1 * p3; p38 = 1 + 2^2 * p20; p37 = 1 + 2^3 * p2 * p3; p36 = 1 + 2^2 * p18; p35 = 1 + 2^8; p34 = 1 + 2^2 * p3^2; p33 = 1 + 2^6 * p1; p32 = 1 + 2 * p2 * p7; p31 = 1 + 2 * p21; p30 = 1 + 2 * p1 * p2^2; p29 = 1 + 2^2 * p11; p28 = 1 + 2^3 * p6; p27 = 1 + 2 * p2 * p5; p26 = 1 + 2 * p1^2 * p3; p25 = 1 + 2^4 * p3; p24 = 1 + 2^2 * p1^3; p23 = 1 + 2 * p1 * p6; p22 = 1 + 2^5 * p1; p21 = 1 + 2 * p12; p20 = 1 + 2 * p1 * p5; p19 = 1 + 2 * p2 * p3; p18 = 1 + 2 * p1 * p4; p17 = 1 + 2^2 * p1 * p2; p16 = 1 + 2 * p9; p15 = 1 + 2^2 * p5; p14 = 1 + 2 * p8; p13 = 1 + 2 * p1 * p3; p12 = 1 + 2^3 * p2; p11 = 1 + 2^2 * p1^2; p10 = 1 + 2 * p1 * p2; p9 = 1 + 2^2 * p3; p8 = 1 + 2 * p4; p7 = 1 + 2 * p1^2; p6 = 1 + 2^4; p5 = 1 + 2^2 * p1; p4 = 1 + 2 * p2; p3 = 1 + 2 * p1; p2 = 1 + 2^2; p1 = 1 + 2.


Cunningham chain of the first kind, length 17.

CC17 is still the longest known chain of the first kind, according to http://primerecords.dk/Cunningham_Chain_records.htm

p33 = 180868411173855991792926719 = 1 + 2 * p32
p32 = 90434205586927995896463359 = 1 + 2 * p31
p31 = 45217102793463997948231679 = 1 + 2 * p30
p30 = 22608551396731998974115839 = 1 + 2 * p29
p29 = 11304275698365999487057919 = 1 + 2 * p28
p28 = 5652137849182999743528959 = 1 + 2 * p27
p27 = 2826068924591499871764479 = 1 + 2 * p26
p26 = 1413034462295749935882239 = 1 + 2 * p25
p25 = 706517231147874967941119 = 1 + 2 * p24
p24 = 353258615573937483970559 = 1 + 2 * p23
p23 = 176629307786968741985279 = 1 + 2 * p22
p22 = 88314653893484370992639 = 1 + 2 * p21
p21 = 44157326946742185496319 = 1 + 2 * p20
p20 = 22078663473371092748159 = 1 + 2 * p19
p19 = 11039331736685546374079 = 1 + 2 * p18
p18 = 5519665868342773187039 = 1 + 2 * p17
p17 = 2759832934171386593519 = 1 + 2 * p8 * p14 * p15 * p16
p16 = 27932129 = 1 + 2^5 * p3 * p6 * p12
p15 = 1915591 = 1 + 2 * p1 * p2 * p13
p14 = 265873 = 1 + 2^4 * p1 * p7 * p9
p13 = 63853 = 1 + 2^2 * p1 * p5 * p11
p12 = 6563 = 1 + 2 * p5 * p10
p11 = 313 = 1 + 2^3 * p1 * p4
p10 = 193 = 1 + 2^6 * p1
p9 = 191 = 1 + 2 * p2 * p6
p8 = 97 = 1 + 2^5 * p1
p7 = 29 = 1 + 2^2 * p3
p6 = 19 = 1 + 2 * p1^2
p5 = 17 = 1 + 2^4
p4 = 13 = 1 + 2^2 * p1
p3 = 7 = 1 + 2 * p1
p2 = 5 = 1 + 2^2
p1 = 3 = 1 + 2

Wednesday, December 21, 2022

[duartbli] Digit strings easy to count their length

It is easy to count the length of the following digit strings:

1
12
123
...
123456789
1234567890
12345678901
123456789012
...
1234567890123456789

Strings like these can serve as example input when it is useful to communicate the length of the string but the content of the string is not important, for example, an example block of data encoded in base 10 (future post vkhdrcsg).  Each string documents its own length.

For strings of lengths 20-29, we write the length-10 string above, then ten 2s, then up to 9 digits:

12345678902222222222
123456789022222222221
1234567890222222222212
...
12345678902222222222123456789

You have to trust that there are ten 2s.  Strings of length 30-39 follow the pattern:

123456789022222222223333333333
1234567890222222222233333333331
12345678902222222222333333333312
...
123456789022222222223333333333123456789

For expository purposes only, we introduce the shorthand (3x10) to indicate ten 3s.  So the above strings of length 30-39 we express as

1234567890(2x10)(3x10)
1234567890(2x10)(3x10)1
1234567890(2x10)(3x10)12
...
1234567890(2x10)(3x10)123456789

This shorthand will become especially useful when we explain longer strings.

The pattern easily extends up to strings of length 99.

Strings of length 10-19 are not (1x10)12345... because 10 and 11 would be difficult to distinguish:

1111111111 11111111111

Replacing long strings of 1s with ascending digits will also become useful later in creating a "ladder".

The first idea for 100 is (1x100), but that has same difficulty as 10-11 for strings of length 101.  Next we try (1x10)(2x10)(3x10)(4x10)(5x10)(6x10)(7x10)(8x10)(9x10)(0x10).  We then replace the initial (1x10) with 1234567890 as we did for 10-19, for reasons we will explain shortly, yielding

1234567890(2x10)(3x10)(4x10)(5x10)(6x10)(7x10)(8x10)(9x10)(0x10)

For strings of length 101-199, we simply append the strings of length 1-99 to the right of the above string.

The strings of length 200-299 has the string of length 100 from above, then (2x100), then the string of length 1-99.  You have to trust that there are 100 2s.  For example, the string of length 200:

1234567890(2x10)(3x10)(4x10)(5x10)(6x10)(7x10)(8x10)(9x10)(0x10)(2x100)

Then we can similarly construct strings of length 300-999 as we did for 30-99.

The string of length 1000 is

1234567890(2x10)(3x10)(4x10)(5x10)(6x10)(7x10)(8x10)(9x10)(0x10)(2x100)(3x100)(4x100)(5x100)(6x100)(7x100)(8x100)(9x100)(0x100)

One can see the recursive structure. The string of length 1000 has the string of length 100 at its beginning, which in turn has the string of length 10 at its beginning.  This "ladder" of more and more stretched out versions of 1234567890 lets you determine what power of 10 you are dealing with by counting the number of recursions.  If we were not to do this, it would be difficult to distinguish between (say) one thousand and ten thousand 1s.  Once we know what power of 10 we are at -- what rung of the ladder we are at -- we can assume that the following long strings of 2s, 3s, etc. each have the same length.

Here is the string of length 1023, illustrating how nothing interesting happens when the length has an internal zero digit:

1234567890(2x10)(3x10)(4x10)(5x10)(6x10)(7x10)(8x10)(9x10)(0x10)(2x100)(3x100)(4x100)(5x100)(6x100)(7x100)(8x100)(9x100)(0x100)1234567890(2x10)123

The string of length 2000 is

1234567890(2x10)(3x10)(4x10)(5x10)(6x10)(7x10)(8x10)(9x10)(0x10)(2x100)(3x100)(4x100)(5x100)(6x100)(7x100)(8x100)(9x100)(0x100)(2x1000)

There will be multiple ladders, one for each nonzero digit in the length of a string.  The string 1234567890 indicates that the previous digit in the length is complete and a new ladder is beginning.  Here is the string of length 2345:

1234567890(2x10)(3x10)(4x10)(5x10)(6x10)(7x10)(8x10)(9x10)(0x10)(2x100)(3x100)(4x100)(5x100)(6x100)(7x100)(8x100)(9x100)(0x100)(2x1000)1234567890(2x10)(3x10)(4x10)(5x10)(6x10)(7x10)(8x10)(9x10)(0x10)(2x100)(3x100)1234567890(2x10)(3x10)(4x10)12345

If possible, text figures (lowercase numerals) should be used to make it easy to spot the beginning of ladders and where digits change.

Haskell source to construct these strings in any base.  Here are the two key routines:

-- expand by 10
dogrow :: Integer -> Char -> String;
dogrow base '1' = List.genericTake (base-1) positive_digits ++ "0";
dogrow base c = List.genericReplicate base c;

-- process little-endian input one digit at a time
growasdigits :: Integer -> [Integer] -> String;
growasdigits _base [] = "";
growasdigits base (h:t) = (growasdigits base t & concatMap (dogrow base)) ++ List.genericTake h positive_digits;

Future work: parser to verify correctness of a string.

Below is the construction in base 4 instead of base 10, showing strings of length 1 through 70.  The first column is string lengths expressed in base 4.

11
212
3123
101230
1112301
12123012
131230123
2012302222
21123022221
221230222212
2312302222123
30123022223333
311230222233331
3212302222333312
33123022223333123
1001230222233330000
10112302222333300001
102123022223333000012
1031230222233330000123
11012302222333300001230
111123022223333000012301
1121230222233330000123012
11312302222333300001230123
120123022223333000012302222
1211230222233330000123022221
12212302222333300001230222212
123123022223333000012302222123
1301230222233330000123022223333
13112302222333300001230222233331
132123022223333000012302222333312
1331230222233330000123022223333123
20012302222333300002222222222222222
201123022223333000022222222222222221
2021230222233330000222222222222222212
20312302222333300002222222222222222123
210123022223333000022222222222222221230
2111230222233330000222222222222222212301
21212302222333300002222222222222222123012
213123022223333000022222222222222221230123
2201230222233330000222222222222222212302222
22112302222333300002222222222222222123022221
222123022223333000022222222222222221230222212
2231230222233330000222222222222222212302222123
23012302222333300002222222222222222123022223333
231123022223333000022222222222222221230222233331
2321230222233330000222222222222222212302222333312
23312302222333300002222222222222222123022223333123
300123022223333000022222222222222223333333333333333
3011230222233330000222222222222222233333333333333331
30212302222333300002222222222222222333333333333333312
303123022223333000022222222222222223333333333333333123
3101230222233330000222222222222222233333333333333331230
31112302222333300002222222222222222333333333333333312301
312123022223333000022222222222222223333333333333333123012
3131230222233330000222222222222222233333333333333331230123
32012302222333300002222222222222222333333333333333312302222
321123022223333000022222222222222223333333333333333123022221
3221230222233330000222222222222222233333333333333331230222212
32312302222333300002222222222222222333333333333333312302222123
330123022223333000022222222222222223333333333333333123022223333
3311230222233330000222222222222222233333333333333331230222233331
33212302222333300002222222222222222333333333333333312302222333312
333123022223333000022222222222222223333333333333333123022223333123
10001230222233330000222222222222222233333333333333330000000000000000
100112302222333300002222222222222222333333333333333300000000000000001
1002123022223333000022222222222222223333333333333333000000000000000012
10031230222233330000222222222222222233333333333333330000000000000000123
101012302222333300002222222222222222333333333333333300000000000000001230
1011123022223333000022222222222222223333333333333333000000000000000012301
10121230222233330000222222222222222233333333333333330000000000000000123012

Thursday, April 28, 2022

[qmuawezq] information content of balanced bits

among all 128-bit numbers, 7% have exactly 64 set bits.  uniformly randomly sampling one such number provides 124.17 bits of entropy.  among n-bit numbers (n even), the number with balanced bits is the central binomial coefficient.  the proportion is asymptotically sqrt(2/(pi*n)), so decreases slowly with larger n.  (incidentally, the relation can be solved for pi, yielding 3.153888 for n=128.)

we compute the entropy of being close to balanced:

s=0; z=64; log(sum(i=z-s,z+s,binomial(2*z,i)))/log(2)

64 +- 1 = 63-65 set bits out of 128: 125.7 bits
64 +- 2: 126.4
64 +- 3: 126.9
64 +- 4: 127.2

130 bits, exactly 65 set: 126.2 bits
132 bits, exactly 66 set: 128.1 bits
156 bits (52*3), exactly 78 set (52*3/2) set: 152.0 bits

so 3 decks of 52 cards, paying attention only to red (diamond or heart suit) or black (club or spade), can store 152 bits.

3 related questions: how can one encode and decode arbitrary data to balanced bitstrings?  related: 8b/10b encoding.

how can one sample a balanced bitstring efficiently?  shuffling (say) 64 red cards and 64 black cards works, but consumes more entropy then necessary.

other direction: given a random balanced bitstring, efficiently extract its entropy.

both of these could be solved by a hypothetical algorithm that computes both directions of a one-to-one map between balanced bitstrings and consecutive integers.

if we had paid attention to more than just red or black: one deck log(52!)/log(2) = 225.6 bits; three separate decks log(52!)*3/log(2) = 676.7 bits; three merged distinct decks log((52*3)!)/log(2) = 916.4 bits.  and then 156 bits more if card rotation by 180 degrees can be distinguished, e.g., non-symmetric back.