metanum 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,674 +1,732 @@
1
- # MetaNum
2
-
3
- [![NPM](https://img.shields.io/npm/v/metanum.svg)](https://www.npmjs.com/package/metanum)
4
-
5
- - MetaNum v1.3 by dlsdl
6
-
7
- A huge number library holding up to X↑↑X&9e15.
8
-
9
- This reaches level f<sub>ε₀</sub>, which is the limit of well-defined expressions in BEAF, hence the name.
10
-
11
- MetaNum provides a robust implementation of hierarchical number representation based on the Hardy hierarchy (HH) and ordinal arithmetic. It can handle numbers far beyond standard JavaScript Number limits, using a sophisticated multi-dimensional array structure to represent ordinal numbers up to ε₀ (ω^ω^ω^……with ω floors). Internally, each MetaNum instance is represented as:
12
-
13
- - **sign**: 1 (positive), -1 (negative), 2 (reciprocal positive), -2 (reciprocal negative)
14
- - **array**: 2-dimensional array `[[r0, e, f, g, ...], [acount, a1, a2, ...], [bcount, b1, b2, ...], ...]` where the first row holds the base value and finite hyper-operation exponents(represents the value of ...g 10^^^'s f 10^^'s e 10^'s r0), and subsequent rows hold ordinal terms(bcount times hyperoperation with ordinal level ...ω^2*b3+ω^*b2+b1 and acount times hyperoperation with ordinal level ...ω^2*a3+ω^*a2+a1, etc.), ordinal terms are sorted by levels from small to big
15
- - **layer**: Non-negative integer representing the ω exponent tower height of hyperoperation level(ω^ω^……(ω polynomial) with layer ω^'s)
16
-
17
- A metanum number is nearly f_ω^ω^…(layer-1 ω^'s)…(…+ω^(…+ω^2*b3+ω^*b2+b1)*bcount+ω^(…+ω^2*a3+ω^*a2+a1)*acount)[…g 10^^^'s f 10^^'s e 10^'s r0](layer>=1) or f…[f^bcount_(…ω^2*b3+ω^*b2+b1)[f^acount_(…ω^2*a3+ω^*a2+a1)[…g 10^^^'s f 10^^'s e 10^'s r0]]…](layer=0) in Fast Growing Hierarchy
18
-
19
- ## Installation
20
-
21
- ```bash
22
- npm install metanum
23
- ```
24
-
25
- ## Creating Instances
26
-
27
- ```javascript
28
- // From a plain number
29
- const a = new MetaNum(42);
30
- const b = MetaNum.fromNumber(-3.14);
31
-
32
- // From a string (supports scientific notation, hyper-operations, letter notation, brackets, etc.)
33
- const c = new MetaNum("1.5e308");
34
- const d = MetaNum.fromString("F5"); // tetration: 10^^5
35
- const e = MetaNum.fromString("E100#2"); // Hyper-E: 10^10^100 (googolplex)
36
- const f = MetaNum.fromString("GF^2 E^3 123"); // letter notation
37
- const g = MetaNum.fromString("Aa100"); // letter notation
38
- const h = MetaNum.fromString("[[10], [1, 3]]"); // bracket notation
39
-
40
- // From an array
41
- const i = MetaNum.fromArray([3.14, 1, 2]); // [[3.14, 1, 2]]
42
- const j = MetaNum.fromArray([10], 1, 1); // layer 1
43
-
44
- // From an object / JSON
45
- const k = MetaNum.fromJSON('{"sign":1,"array":[[42]],"layer":0}');
46
- const l = MetaNum.fromObject({ sign: 1, array: [[1, 2]], layer: 0 });
47
-
48
- // From BigInt
49
- const m = MetaNum.fromBigInt(10n ** 100n);
50
-
51
- // From Hyper-E notation
52
- const n = MetaNum.fromHyperE("EE100");
53
- ```
54
-
55
- ## Constants
56
-
57
- ```javascript
58
- MetaNum.MAX_SAFE_INTEGER // 9007199254740991
59
- MetaNum.E_
60
- MetaNum.POSITIVE_INFINITY // Infinity
61
- MetaNum.NEGATIVE_INFINITY // -Infinity
62
- MetaNum.GRAHAMS_NUMBER // Graham's number (approximation)
63
- MetaNum.TRITRI // 3↑↑↑3 = 3^^^3
64
- MetaNum.QqQe308 // QqQe308 (for incremental games)
65
- ```
66
-
67
- ## Basic Usage
68
-
69
- ```javascript
70
- // Arithmetic
71
- const sum = MetaNum.add(15, 27); // 42 (static)
72
- const diff = new MetaNum(27).sub(15); // 12 (instance)
73
- const product = new MetaNum(15).mul(27); // 405
74
- const quotient = new MetaNum(27).div(15); // 1.8
75
-
76
- // Power & roots
77
- new MetaNum(2).pow(10); // 1024
78
- new MetaNum(100).sqrt(); // 10
79
- new MetaNum(27).cbrt(); // 3
80
- new MetaNum(8).root(3); // 2
81
- new MetaNum(10).exp(); // e^10
82
-
83
- // Logarithms
84
- new MetaNum(100).log10(); // 2
85
- new MetaNum(8).log(2); // 3
86
- new MetaNum(Math.E).ln(); // 1
87
-
88
- // Comparison
89
- const x = new MetaNum(10), y = new MetaNum(20);
90
- x.lt(y); // true
91
- x.gt(y); // false
92
- x.eq(y); // false
93
- x.lte(y); // true
94
- x.gte(y); // false
95
- x.neq(y); // true
96
- x.min(y); // 10
97
- x.max(y); // 20
98
-
99
- // Comparison with tolerance
100
- x.eq_tolerance(new MetaNum(10.0001), 1e-3); // true
101
- x.cmp_tolerance(y, 1e-7); // -1
102
-
103
- // Sign checks
104
- x.ispos(); // true
105
- x.isneg(); // false
106
- x.isNaN(); // false
107
- x.isFinite(); // true
108
- x.isint(); // true
109
-
110
- // Rounding
111
- new MetaNum(3.7).floor(); // 3
112
- new MetaNum(3.2).ceil(); // 4
113
- new MetaNum(3.5).round(); // 4
114
-
115
- // Reciprocal & absolute
116
- new MetaNum(4).rec(); // 0.25
117
- new MetaNum(-5).abs(); // 5
118
- new MetaNum(5).neg(); // -5
119
-
120
- // Factorial & Gamma
121
- new MetaNum(5).fact(); // 120
122
- new MetaNum(0.5).gamma(); // Γ(0.5) = √π
123
-
124
- // Modulo
125
- new MetaNum(10).mod(3); // 1
126
-
127
- // Lambert W function
128
- new MetaNum(1).lambertw(); // Ω ≈ 0.5671
129
- ```
130
-
131
- ## Hyper-Operations (Tetration & Beyond)
132
-
133
- ```javascript
134
- // Tetration: a^^b
135
- new MetaNum(2).tetr(3); // 2^^3 = 2^2^2 = 16
136
- new MetaNum(2).tetr(4); // 2^^4 = 65536
137
- MetaNum.tetr(2, 5); // 2^^5
138
-
139
- // With payload (offset)
140
- new MetaNum(10).tetr(2, new MetaNum(5)); // 10^^2 with payload 5
141
-
142
- // Pentation: a^^^b
143
- new MetaNum(2).pent(3); // 2^^^3
144
-
145
- // General arrow notation: a↑^n b
146
- new MetaNum(2).arrow(3)(4); // 2↑↑↑4 (pentation)
147
- MetaNum.arrow(3, 4, 3); // 3↑↑↑↑3 = g_1
148
-
149
- // Chain notation
150
- new MetaNum(2).chain(4, 3); // 2→4→3
151
-
152
- // Aperiation: a↑^a a
153
- new MetaNum(2).aper(3); // 2↑↑↑2 = 4
154
- ```
155
-
156
- ## Super-logarithm & Super-root
157
-
158
- ```javascript
159
- // Super-logarithm (inverse of tetration)
160
- new MetaNum(16).slog(2); // slog_2(16) = 3
161
- new MetaNum(65536).slog(); // slog_10(65536) ≈ 2
162
-
163
- // Super-square-root
164
- new MetaNum(27).ssrt(); // ssqrt(27)
165
-
166
- // Linear super-root
167
- new MetaNum(100).linear_sroot(3); // ³ss̅r̅t̅(100)
168
-
169
- // Layer arithmetic
170
- new MetaNum(10).layeradd(3); // add 3 layers of exponentiation
171
- new MetaNum(10).layeradd10(3); // 10^^3 (explicit base 10)
172
- ```
173
-
174
- ## Hyper-Operations up to ε₀
175
-
176
- These functions represent iterated diagonalizations at increasing ordinal levels from ω to ε₀:
177
-
178
- ```javascript
179
- const x = new MetaNum(10);
180
-
181
- // Level ω: diagonalize ω*y (→ a↑^a a)
182
- x.aperiote(3); // aper(3) = h10
183
-
184
- // Level ω+1: iterate aperiote
185
- x.expande(3); // expa(3) = h11
186
-
187
- // Level ω+2: iterate expande
188
- x.multiexpande(3); // muea(3) = h12
189
-
190
- // Level ω+3: iterate multiexpande
191
- x.powerexpande(3); // poea(3) = h13
192
-
193
- // Level ω*2: diagonalize ω+y
194
- x.aperioexpande(3); // apea(3) = h20
195
-
196
- // Level ω*2+1: iterate aperioexpande
197
- x.explode(3); // expl(3) = h21
198
-
199
- // Level ω*2+2: iterate explode
200
- x.multiexplode(3); // muel(3) = h22
201
-
202
- // Level ω*3: diagonalize ω*2+y
203
- x.aperioexplode(3); // apel(3) = h30
204
-
205
- // Level ω*3+1: iterate aperioexplode
206
- x.detonate(3); // deto(3) = h31
207
-
208
- // Level ω*4: diagonalize ω*3+y
209
- x.aperiodetonate(3); // apdt(3) = h40
210
-
211
- // Level ω^2: diagonalize ω*y
212
- x.aperionate(3); // apeo(3) = h100
213
-
214
- // Level ω^2+1: iterate aperionate
215
- x.megote(3); // mego(3) = h101
216
-
217
- // Level ω^2+2: iterate megote
218
- x.multimegote(3); // mume(3) = h102
219
-
220
- // Level ω^2+ω: diagonalize ω^2+y
221
- x.aperimegote(3); // apmg(3) = h110
222
-
223
- // Level ω^2+ω+1: iterate aperimegote
224
- x.megoexpande(3); // mgea(3) = h111
225
-
226
- // Level ω^2+ω*2: diagonalize ω^2+ω+y
227
- x.aperimegoexpande(3); // apme(3) = h120
228
-
229
- // Level ω^2*2: diagonalize ω^2+ω*y
230
- x.megoaperionation(3); // mgao(3) = h200
231
-
232
- // Level ω^2*2+1: iterate megoaperionation
233
- x.gigote(3); // gigo(3) = h201
234
-
235
- // Level ω^2*2+ω: diagonalize ω^2*2+y
236
- x.aperigigote(3); // apgg(3) = h210
237
-
238
- // Level ω^2*3: diagonalize ω^2*2+ω*y
239
- x.gigoaperionate(3); // ggap(3) = h300
240
-
241
- // Level ω^3: diagonalize ω^2*y
242
- x.aperiatotion(3); // apat(3) = h1000
243
-
244
- // Level ω^3+1: iterate aperiatotion
245
- x.powiainate(3); // pwan(3) = h1001
246
-
247
- // Level ω^3+ω: diagonalize ω^3+y
248
- x.expandainate(3); // epan(3) = h1010
249
-
250
- // Level ω^3+ω^2: diagonalize ω^3+ω*y
251
- x.megodainate(3); // mgan(3) = h1100
252
-
253
- // Level ω^3*2: diagonalize ω^3+ω^2*y
254
- x.powiairate(3); // pwar(3) = h2000
255
-
256
- // Level ω^4: diagonalize ω^3*y
257
- x.aperioguate(3); // apgu(3) = h10000
258
-
259
- // Level ω^ω: diagonalize ω^x (layer 1 transition)
260
- x.iter(3); // ite(3) = hww
261
-
262
- // Level ω^ω+1: iterate ω^ω level operations
263
- x.itermult(3); // itmu(3) = hw01
264
-
265
- // Level ω^ω*2: (ω^ω)*2 = ω^ω + ω^base
266
- x.cuboiter(3); // cube(3) = hwx2
267
-
268
- // Level ω^(ω+1): ω^(ω+1) = ω^ω*ω → ω^(ω*y)
269
- x.expoiter(3); // expo(3) = hwa1
270
-
271
- // Level ω^(ω*2): ω^(ω*2) = ω^(ω+base)
272
- x.trioterate(3); // tria(3) = hwm2
273
-
274
- // Level ω^(ω^2): diagonalize ω^(ω*y) (layer 2)
275
- x.trixxate(3); // trix(3) = hwp2
276
-
277
- // Level ω^(ω^ω): diagonalize ω^(ω^y) (layer 3)
278
- x.aperixxate(3); // apix(3) = hwpw
279
-
280
- // Level ε₀ = ω↑↑ω: diagonalize ω↑↑y (layer 4)
281
- x.epsilonate(3); // epsl(3) = hepsl
282
- ```
283
-
284
- ## Inverse Operations
285
-
286
- Each expansion operation has a corresponding inverse for decrementing ordinal structure:
287
-
288
- ```javascript
289
- x.i_aper(z) // i10 = inverse of aperiote
290
- x.i_expa(z) // i11 = inverse of expande
291
- x.i_muea(z) // i12 = inverse of multiexpande
292
- x.i_poea(z) // i13 = inverse of powerexpande
293
- x.i_apea(z) // i20 = inverse of aperioexpande
294
- x.i_expl(z) // i21 = inverse of explode
295
- x.i_muel(z) // i22 = inverse of multiexplode
296
- x.i_apel(z) // i30 = inverse of aperioexplode
297
- x.i_deto(z) // i31 = inverse of detonate
298
- x.i_apdt(z) // i40 = inverse of aperiodetonate
299
- x.i_apeo(z) // i100 = inverse of aperionate
300
- x.i_mego(z) // i101 = inverse of megote
301
- x.i_mume(z) // i102 = inverse of multimegote
302
- x.i_apmg(z) // i110 = inverse of aperimegote
303
- x.i_mgea(z) // i111 = inverse of megoexpande
304
- x.i_apme(z) // i120 = inverse of aperimegoexpande
305
- x.i_mgao(z) // i200 = inverse of megoaperionation
306
- x.i_gigo(z) // i201 = inverse of gigote
307
- x.i_apgg(z) // i210 = inverse of aperigigote
308
- x.i_ggap(z) // i300 = inverse of gigoaperionate
309
- x.i_apat(z) // i1000 = inverse of aperiatotion
310
- x.i_pwan(z) // i1001 = inverse of powiainate
311
- x.i_epan(z) // i1010 = inverse of expandainate
312
- x.i_mgan(z) // i1100 = inverse of megodainate
313
- x.i_pwar(z) // i2000 = inverse of powiairate
314
- x.i_apgu(z) // i10000 = inverse of aperioguate
315
- x.i_ite(z) // iww = inverse of iter
316
- x.i_itmu(z) // iw01 = inverse of itermult
317
- x.i_cube(z) // iwx2 = inverse of cuboiter
318
- x.i_expo(z) // iwa1 = inverse of expoiter
319
- x.i_tria(z) // iwm2 = inverse of trioterate
320
- x.i_trix(z) // iwp2 = inverse of trixxate
321
- x.i_apix(z) // iwpw = inverse of aperixxate
322
- x.i_epsl(z) // iepsl = inverse of epsilonate
323
- ```
324
-
325
- ## BEAF Operations
326
-
327
- Bowers' Exploding Array Function (BEAF) is supported via ordinal arithmetic for 4+ arguments:
328
-
329
- ```javascript
330
- // 3-entry: {a,b,c} = a↑^c b (standard up-arrow notation)
331
- MetaNum.BEAF(3, 3, 2); // 3↑↑3 = 7625597484987
332
- MetaNum.BEAF(3, 3, 3); // 3↑↑↑3 = tritri
333
-
334
- // 4-entry: {a,b,c,d} = a(ω*(d-1)+(c-1) level operation)b
335
- MetaNum.BEAF(2, 2, 1, 2); // = 4
336
- MetaNum.BEAF(3, 3, 3, 3); // 3(ω*2+2 level operation)3
337
-
338
- // 5+ entry: ordinal arithmetic
339
- // BEAF(a,b,c,d,...,n) = a(ω^(n-3)*(arg_n-1)+...+ω*(d-1)+(c-1) level operation)b
340
- MetaNum.BEAF(10, 2, 1, 1, 2); // = BEAF(10,10,10,10) (ω^2 level operation)
341
- MetaNum.BEAF(3, 3, 3, 3, 2); // 3(ω^2+ω*2+2 level operation)3
342
-
343
- // Parse BEAF string notation
344
- MetaNum.fromBeaf("{3,3,3}"); // 3↑↑↑3
345
- MetaNum.fromBeaf("{3,3,3,3}"); // 3(ω*2+2)3
346
- MetaNum.fromBeaf("{10,2,1,1,2}"); // 10(ω^2)2
347
-
348
- // Convert to BEAF string
349
- new MetaNum(7625597484987).toBeaf(); // "{7625597484987}"
350
- MetaNum.BEAF(3,3,3).toBeaf(); // "{3638334640023.7783}"
351
- ```
352
-
353
- ## Layer & Serialization
354
-
355
- ```javascript
356
- // Layer manipulation
357
- new MetaNum(10).layerUp(); // promote to layer+1
358
- new MetaNum(10).layerDown(); // demote to layer-1
359
-
360
- // Output formats
361
- new MetaNum(123).toString(); // "123"
362
- new MetaNum(1e308).toString(); // "E308"
363
- new MetaNum(100).toNumber(); // 100
364
- new MetaNum(100).valueOf(); // "100"
365
- new MetaNum(100).toFixed(2); // "100.00"
366
- new MetaNum(100).toExponential(2); // "1.00e+2"
367
- new MetaNum(100).toPrecision(3); // "100"
368
- new MetaNum(100).toHyperE(); // "100"
369
- new MetaNum(100).toStringWithDecimalPlaces(4); // "100.0000"
370
- new MetaNum(100).toJSON(); // {sign:1, array:[[100]], layer:0}
371
- ```
372
-
373
- ## Utility Functions
374
-
375
- ```javascript
376
- // Binomial coefficient
377
- new MetaNum(10).choose(3); // C(10,3) = 120
378
-
379
- // Hyper-operation
380
- MetaNum.hyper(4, 2, 3); // 2^^3 = 16 (n=4 means tetration)
381
-
382
- // Geometric series
383
- MetaNum.sumGeometricSeries(5, 1, 2); // 1+2+4+8+16 = 31
384
- MetaNum.affordGeometricSeries(100, 1, 2, 0);
385
-
386
- // Arithmetic series
387
- MetaNum.sumArithmeticSeries(5, 1, 2); // 1+3+5+7+9 = 25
388
- MetaNum.affordArithmeticSeries(100, 1, 2, 0);
389
-
390
- // Configuration
391
- MetaNum.config({ maxRows: 200, maxCols: 200, maxArrow: 1e6, debug: 1 });
392
- ```
393
-
394
- ## Mathematical Background
395
-
396
- The library implements the Hardy hierarchy (HH), which is a hierarchy of functions indexed by ordinal numbers. The representation uses Cantor normal form for ordinals, where:
397
-
398
- - ω represents the first infinite ordinal
399
- - ω^ω represents ω raised to the power of ω
400
- - ε₀ is the limit of ω, ω^ω, ω^ω^ω, ...
401
-
402
- For more information, see: <https://en.wikipedia.org/wiki/Ordinal_arithmetic>
403
-
404
- The layer parameter indicates the height of the ω exponent tower, allowing representation of increasingly large ordinals.
405
-
406
- ## dlsdl's Letter Notation
407
-
408
- Modified from PsiCubed's letter notation(<https://googology.fandom.com/wiki/User_blog:PsiCubed2/My_Letter_Notation>)
409
-
410
- The idea here is to extend the PsiCubed's letter notation to much larger numbers reach level ε0 of FGH or HH. The properties we wish to preserve here are:
411
-
412
- (1) Any number has a unique standard representation in the system.
413
-
414
- (2) Given the standard representation of two numbers, one can immediately tell which one is larger without any calculations.
415
-
416
- ### The format of the proposed notation
417
-
418
- Our final notation will look like this:
419
-
420
- \[symbol]\[letter]\[number]
421
-
422
- where \[symbol] can be one of the following: empty,!,@,#,$,%,&,……
423
-
424
- where \[letter] can be one of the following: E,F,G,H,……,Aa,Ab,Ac,……,Ba,Bb,……,Aaa,……
425
-
426
- and \[number] can be any positive real number (nonintegers included).
427
-
428
- ### The First Levels: A Continuous version of Knuth Arrows
429
-
430
- We'll define:
431
-
432
- Eα=10^α
433
-
434
- Fα = EEEE...EEE(10^frac(α)) with int(α) E's
435
-
436
- Gα = FFFF...FFF(10^frac(α)) with int(α) F's
437
-
438
- Hα = GGGG...GGG(10^frac(α)) with int(α) G's
439
-
440
- then we'll have I,J,K,... to Z ,each with the same definition as Hα.
441
-
442
- Note that according to these definitions we have:
443
-
444
- (1) For α≤1: Eα = Fα = Gα = Hα = ... = Zα = 10^α
445
-
446
- (2) For any integer β: Eβ = 10↑β, Fβ = 10↑↑β, Gβ = 10↑↑↑β, Hβ = 10↑↑↑↑β
447
-
448
- the γ-th letter β represents 10(γ-4 arrows)β
449
-
450
- So the above definitions are indeed an extention of Knuth arrows to nonintegers.
451
-
452
- ### Letter-Canonical Forms
453
-
454
- If α is a number greater than 1 and Γ is a one of the letters E,F,G,H,...,ζ then there is a unique number β such that:
455
-
456
- α = Γβ.
457
-
458
- And we call "Γβ" the Γ-Canonical Form of the number α.
459
-
460
- For example, the E-Canonical form of 1000 is E3:
461
-
462
- E3 = 10^3 = 1000.
463
-
464
- And the F-Canonical form of 1000 is about F1.47712:
465
-
466
- F1.47712 = E(10^0.47712) ≈ E3 = 10^3 = 1000.
467
-
468
- ### Binary-Letter-Canonical Forms
469
-
470
- To recreate ordinary scientific notation, we'll define a binary version of the letter functions like this:
471
-
472
- Let Γ be one of the letters E,F,G,H,...,ζ Let β be a nonnegative integer and α be a real number between 1 and 10. Then:
473
-
474
- αΓβ = Γ(β+log(α))
475
-
476
- For Example:
477
-
478
- 7E3 = E(3+log(7)) = 10^(3+log(7)) = 7\*10^3 = 7000
479
-
480
- 7F3 = F(3+log(7)) = EEE(10^log(7)) = EEE7 = 10^10^10^7
481
-
482
- So αEβ is nothing more than ordinary scientific notation.
483
-
484
- And αFβ is a power tower of β 10's topped by an α.
485
-
486
- And again, given any specific letter (E,F,G,H,...,ζ), ANY number greater than 1 has a unique representation as αΓβ (with 1≤α<β). So we can call this the Binary-Γ-Canonical Form of α.
487
-
488
- ### Defining Aa - The First Diagonalization
489
-
490
- In the previous section we've defined an infinite sequence of functions, so we can diagonalize over them:
491
-
492
- let 1|α = Eα, 2|α = Fα, 3|α = Gα, ..., 22|α = Zα.
493
-
494
- we had: Aaα = α|10.
495
-
496
- So Aa is comparable to f\_ω\_(n) in the FGH.
497
-
498
- But there are a couple of problems here:
499
-
500
- (1) α|10 isn't yet defined for noninteger α.
501
-
502
- (2) Aa1 would be 1|10 = 10^10 rather than 10 = E1 = F1 = G1 =...= Z1. This would have caused trouble later on, when we define the higher levels.To solve these two problems, we'll give a definition for α|10 and amend the definition of Aa:
503
-
504
- (i) α|10 = (int(α)+1)|2\*5^frac(α)
505
-
506
- (ii) For α<2: Aaα = Gα
507
-
508
- (iii) For α≥2: Aaα = α|10
509
-
510
- The seemingly complex expression in rule (i) simply gives us a smooth geometric curve between 2 and 10. This ensures that Aa would be continuous, given the identity 10↑(β)10 = 10↑(β+1)2.
511
-
512
- ### Ab,Ac,Ad,...,Az and their Universal Canonical Forms
513
-
514
- The definitions of Ab,Ac,Ad,...,Az are simple enough:
515
-
516
- Abα = AaAa...AaAa(10^frac(α)) with int(α) Aa's
517
-
518
- Acα = AbAb...AbAb(10^frac(α)) with int(α) Ab's
519
-
520
- then we have Ad,Ae,...,Az, each with the same definition as Ab and Ac.
521
-
522
- And that's it. So A(the β+1-th letter) is comparable to f\_ω+β\_(n) in the FGH.
523
-
524
- Again we have Ab0=Ac0=Ad0=...=Az0=1, Ab1=Ac1=Ad1=...=Az1=10, and Ab,Ac,Ad,...,Az are all continuous. So any number greater than 1 has a unique Ab to Az Canonical Form.
525
-
526
- Moreover, since Aa10=Ab2 and Ab10=Ac2, we can extend our definition of the "Universal Canonical Form" up to Az10:
527
-
528
- (1) if α<100 (that's E2) then we write down the E-Canonical Form of α.
529
-
530
- (2) Otherwise, we write α as Γβ for some letter combinations Γ and 2≤β<10. If there is more than one possible choice, we choose the letter combination which comes first in order.
531
-
532
- ### Defining from Ba to Bz
533
-
534
- We already know how to do recursion (F,G,H,I,...,ζ) and simple diagonalization (Aa) in our continuous system, so we can easily extend our system up to ω×2-level in the FGH. In order to track our progress, we'll use the format (1,β)|α and define:
535
-
536
- (1,0)|α = Aaα
537
-
538
- (1,β+1)|α = (1,β)|(1,β)|...|(1,β)|10^frac(α) with int(α) (1,β)'s
539
-
540
- And define Baα in a way similar to Aaα:
541
-
542
- (i) (1,α)|10 = (1,int(α)+1)|2\*5^frac(α)
543
-
544
- (ii) For α<2: Baα = (1,3)|α
545
-
546
- (iii) For α≥2: Baα = (1,α)|10
547
-
548
- This gives rise to writing numbers in Ba-Canonical form and extend the Universal Canonical Form up to Ba10 ,which is about f\_ω×2\_(10) in the FGH.
549
-
550
- Then we can define Bb,Bc, Bd,...,Bz with recursions in a similar way. Bbα = BaBa...BaBa(10^frac(α)) with int(α) Ba's, and Bcα = BbBb...BbBb(10^frac(α)) with int(α) Bb's, etc. B(the β+1-th letter) is comparable to f\_ω\*2+β\_(n) in the FGH.
551
-
552
- ### A Supporting Array Notation and Aaa
553
-
554
- We can, of-course, repeat what we did in the previous section as many times as we wish and get the following ω^2-level notation (β,γ ≥ 0 are integers, and α≥0 is real):
555
-
556
- (i) (0,1)|α = 10^α
557
-
558
- (ii) (β,γ+1)|α = (β,γ)|(β,γ)|...|(β,γ)|10^frac(α) with int(α) (β,γ)'s
559
-
560
- (iii) (β,α)|10 = (β,int(α)+1)|2\*5^frac(α)
561
-
562
- (iv) For α<2: (β+1,0)|α = (β,3)|α
563
-
564
- (v) For α≥2: (β+1,0)|α = (β,α)|10
565
-
566
- Note that (β,γ) is comparable to f\_ω\*β+γ\_(α) in the FGH. Also, if we read (0,γ)|α as γ|α, this notation is a direct extension of everything we did before this section. Also, in this new notation we can write Baα = (2,0)|α, Bbα = (2,1)|α,... Bzα = (2,25)|α.
567
-
568
- So QqQe308 is about f\_ω17+16\_(f\_ω17+4\_(308)).
569
-
570
- And with this new supporting notation we can now to define Aaaα:
571
-
572
- (i) For α<2: Aaaα = (2,1)|α
573
-
574
- (ii) For α≥2: Aaaα = (int(α),10\*frac(α))|10
575
-
576
- With rule (ii) containing a very neat trick that allows us to do the double-diagonalization with a single number: Aaa1.5 = (2,1)|1.5, Aaa2.5 = (2,5)|10
577
-
578
- At any rate, it isn't too difficult to see that Aaa behaves "nicely" and allows us to speak of Aaa-Canonical Forms of any number. And since Aaa2=Ba10, Aaa3=Ca10,..., Aaa26=Za10, this also enables us to write the Unversal Canonical Form of any number about f\_ω^2\_(10) in the FGH.
579
-
580
- ### Arrays with more than two variable, and !Aa
581
-
582
- Array notations can be easily extended to a multivariable array notation, like so:
583
-
584
- (i) For α≤1: (anything)|α = 10^α
585
-
586
- (ii) (β,γ,δ,...,ν+1)|α = (β,γ,δ,...,ν)|(β,γ,δ,...,ν)|...|(β,γ,δ,...,ν)|10^frac(α) with int(α) (β,γ,δ,...,ν)'s
587
-
588
- (iii) (β,γ,δ,...,ν,α)|10 = (β,γ,δ,...,ν,int(α+1))|2\*5^frac(α)
589
-
590
- (iv) For 1<α<2: (β,γ,δ,...,μ+1,<κ zeros>)|α = (β,γ,δ,...,μ,2,<κ-1 zeros>)|10^(α-1)
591
-
592
- (v) For α≥2: (β,γ,δ,...,μ+1,<κ zeros>)|α = (β,γ,δ,...,μ,α,<κ-1 zeros>)|10
593
-
594
- (vi) (β,γ,δ,...,α,<κ zeros>)|10 = (β,γ,δ,...,int(α),frac(α)\*10,<κ-1 zeros>)|10
595
-
596
- (vii) (0,...,0,β,γ,δ,...,μ)|α = (β,γ,δ,...,μ)|α
597
-
598
- The first 5 rules are a simple and direct extention of the 2-variable arrays notation, and Rule vii simply states that leading zeros can be ommitted.
599
-
600
- Rule vi is an interesting one, though. It basically tells us that if we have an array which ends with (...,α,0,0,...,0) then the digits of the fractional part of α are to be distributed among the zeros. For example:
601
-
602
- - (114,514,1.9198,0,0,0,0)|10 = (114,514,1,9,1,9,8)|10.
603
-
604
- Now, all that is left to do is to define !Aa, which is about f\_ω^ω\_(10) in the FGH.
605
-
606
- For α<2: !Aaα = (1,0,1)|α
607
-
608
- For α≥2: !Aaα = (10^frac(α),0,...,0)|10 with int(α) zeros.
609
-
610
- Then we have !Aa2 = Aaa10, !Aa3 = Aaaa10,... Just like the previous letters, any number can be written as !Aaα. Here, it is actually the binary form of α!Aaβ = !Aa(β+logα) which has the most intuitive meaning for β≥2:
611
-
612
- In terms of the array notation, β+1 tells us how many numbers are in the array and the digits of α tell us the what those numbers are. For example: 1.2345!Aa4 = (1,2,3,4,5)|10
613
-
614
- And in terms of FGH ordinals, β gives us the maximum power of ω and the digits of α give us the coefficents of the various powers of ω: 1.2345!Aa4 \~ f\_ω^4+ω^3\*2+ω^2\*3+ω\*4+5\_(10). Actually, these neat relations are also true for β=1 and α≥2, so 2.5!Aa1 = (2,5)|10.
615
-
616
- ### Higher dimensional arrays and @Aa
617
-
618
- With the definition of the array notation and the symbol !, one can easily define palanar array notation function. In this notation, the comma is short for \[0], and the dimensional seperator is \[1], ζ's represent 0's and dimensional seperators (or can be empty) and κ zeroes. κ+1 zerores means a group of zeroes and dimensional seperators starting with at least 1 zero. κ zeroes is that but it doesn't need to start with a zero.
619
-
620
- (i) Other rules are the same from linear array notation
621
-
622
- (ii) (β,γ,δ,...,μ+1\[1]0,ζ)|α = (β,γ,δ,...,μ\[1]1,0,0,ζ)|10^(x-1) for 1\<x<2
623
-
624
- (iii) (β,γ,δ,...,μ+1\[1]0,ζ)|α = (β,γ,δ,...,μ\[1]10^frac(x),0,...,0,ζ)|10 with int(x) 0's for x=>2
625
-
626
- (iv) (β,γ,δ,...,α\[1]0,ζ)|10, κ = frac(α)\*10
627
-
628
- It equals to (β,γ,δ,...,int(α)\[1]10^frac(κ),0,...,0,ζ)|10 with int(κ) 0's where κ >=1 or there is only 1 \[1] and there is a 1 before it, or (β,γ,δ,...,int(α)\[1]frac(κ),ζ)|10 otherwise
629
-
630
- (v) (...\[1]0,...,0,β,γ...)|α = (...\[1]β,γ...)|α
631
-
632
- Rule 2 and 3 are the case where the last nonzero entry is at the end of a plane and is an integer. Rule 4 is when the last nonzero entry is at the end of a plane, you use the fractional part of the last entry, and put it in the next row.
633
-
634
- By adding ! before a letter notation, it changes from HH to FGH. Aa represents H\_ω, so !Aa represents f\_ω which equals to H\_ω^ω. Then we can define !Ab (f\_ω^(ω+1)_(10) in FGH), !Ac, !Ad,..., !Az with the same meaning as !Aa, and !Ba(f\_ω^(ω2)_(10) in FGH), !Bb, !Bc, ..., !Bz, !Aaa, etc. Comparing these with the previous letters, we can see that notations with ! symbol have a more ω^ in FGH than those without ! symbol.
635
-
636
- Fractional number of rows, columns, etc.. are defined in the same way as in the linear array notation, \[0] is the comma. ζ is an array of 0's and dimensional seperators.
637
-
638
- For level comparison, first compare the levels of the highest-leveled seperators. If they are equal, then compare the number of highest-leveled subseperators. If there are the same number, compare everything in the seperator after the last occurance of the highest-leveled seperator in a seperator. If they are equal, do that with the string before the last ocurrence of the highest-leveled seperator. If they are the same, the seperators have the same level.
639
-
640
- Now, all that is left to do is to define @Aa, which is about f\_ω^ω^ω\_(10) in the FGH.
641
-
642
- For α<2: @Aaα = (1\[1,0,0]0)|α
643
-
644
- For α≥2: @Aaα = (1\[10^frac(α),0,...,0]0)|10 with int(α) zeros.
645
-
646
- ### Nested arrays and more symbols
647
-
648
- The Definiton of more symbols is similar to the definition of @Aa.
649
-
650
- \#Aa \~ f\_ω^ω^ω^ω\_(10)
651
-
652
- $Aa \~ f\_ω^ω^ω^ω^ω\_(10)
653
-
654
- Then we can define (the β-th symbol or symbol combination)Aa = f\_ω^ω^...^ω(β+1 ω's)\_(10)
655
-
656
- ### Definition of the final letter: ε
657
-
658
- ε represents exponent tower layers of ω, and it is comparable to f\_ε0\_(10) in the FGH.
659
-
660
- αεβ \~ f\_ω^ω^...^ω(β ω's)\_(α)
661
-
662
- #### Using dlsdl's letter notation, the biggest number we can define in Metanum is about ε1.797e308.
663
-
664
- ## Changelog
665
-
666
- - 2026-7-31 v1.3 Add format-metanum.js, fix basic operations, hyper operations and BEAF bugs
667
- - 2026-7-9 v1.2 Add more hyper operations up to ε₀, add BEAF operation and fix bugs
668
- - 2026-6-3 v1.1 Add support for very small numbers ,add more hyper operations and fix bugs
669
- - 2026-5-23 v1.0 Rewritten and add even more hyper operations
670
- - 2026-2-24 v0.4 Add hyper operations and extend fromString
671
- - 2026-2-11 v0.3 Reconstruct code and correct calculating functions
672
- - 2026-2-6 v0.2 New Metanum data structure with Cantor normal form
673
- - 2026-2-1 v0.1 First commit
674
-
1
+ # MetaNum
2
+
3
+ [![NPM](https://img.shields.io/npm/v/metanum.svg)](https://www.npmjs.com/package/metanum)
4
+
5
+ - MetaNum v1.4 by dlsdl
6
+
7
+ A huge number library holding up to X↑↑X&9e15.
8
+
9
+ This reaches level f<sub>ε₀</sub>, which is the limit of well-defined expressions in BEAF, hence the name.
10
+
11
+ MetaNum provides a robust implementation of hierarchical number representation based on ordinal arithmetic. It can handle numbers far beyond standard JavaScript Number limits, using a sophisticated multi-dimensional array structure to represent ordinal numbers up to ε₀ (ω^ω^ω^……with ω floors). Internally, each MetaNum instance is represented as:
12
+
13
+ - **sign**: 1 (positive), -1 (negative), 2 (reciprocal positive), -2 (reciprocal negative)
14
+ - **array**: 2-dimensional array `[[r0, r1, r2, ...,rn], [acount, a1, a2, ...,ax], [bcount, b1, b2, ...,by], ...,[mcount, m1, m2, ...,mz]]` where the first row holds the base value and finite hyper-operation exponents and subsequent rows hold ordinal terms, ordinal terms are sorted by levels from small to big
15
+ - **layer**: Non-negative integer representing the ω exponent tower height of hyperoperation level(ω^ω^……(ω polynomial) with layer ω^'s)
16
+
17
+ Using extended arrow operations(see #Mathematical Background), a metanum number can be represented as \[none(sign=1)|-(sign=-1)|1/(sign=2)|-1/(sign=-2)] \[mcount(10{ω^(z-1)\*mz+...+ω^2\*m3+ω\*m2+m1})'s ... bcount(10{ω^(y-1)\*by+...+ω^2\*b3+ω\*b2+b1})'s acount(10{ω^(x-1)\*ax+...+ω^2\*a3+ω\*a2+a1})'s rn(10{n})'s ... r3(10{3})'s r2(10{2})'s r1(10{1})'s r0 (layer=0)|10{ω^ω^...(layer-1 ω^'s) (ω^(ω^(z-1)\*mz+...+ω^2\*m3+ω\*m2+m1)\*mcount+...+ω^(ω^(y-1)\*by+...+ω^2\*b3+ω\*b2+b1)\*bcount+ω^(ω^(x-1)\*ax+...+ω^2\*a3+ω\*a2+a1)\*acount+ω^n\*rn+...+ω^3\*r3+ω^2\*r2+ω\*r1+r0)}10 (layer>=1)]
18
+
19
+ In Fast Growing Hierarchy, a metanum number is nearly `f_ω^ω^…(layer-1 ω^'s)…(ω^(ω^(z-1)*mz+…+ω^2*m3+ω^*m2+m1)*mcount+…+ω^(ω^(y-1)*by+…+ω^2*b3+ω*b2+b1)*bcount+ω^(ω^(x-1)*ax+…+ω^2*a3+ω*a2+a1)*acount+ω^n*rn+…+ω^3*r3+ω^2*r2+ω*r1+r0)[10](layer>=1)` or `f^mcount_(ω^(z-1)*mz+…+ω^2*m3+ω^*m2+m1)[…[f^bcount_(ω^(y-1)*by+…+ω^2*b3+ω^*b2+b1)[f^acount_(ω^(x-1)*ax+…+…ω^2*a3+ω*a2+a1)[rn 10{n}'s … r3 10^^^'s r2 10^^'s r1 10^'s r0]]…](layer=0)`
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ npm install metanum
25
+ ```
26
+
27
+ ## Creating Instances
28
+
29
+ ```javascript
30
+ // From a plain number
31
+ const a = new MetaNum(428571);
32
+ const b = MetaNum.fromNumber(-2.71828);
33
+
34
+ // From a string (supports scientific notation, hyper-operations, letter notation, brackets, etc.)
35
+ const c = new MetaNum("1.5e308");
36
+ const d = MetaNum.fromString("F5"); // tetration: 10^^5
37
+ const e = MetaNum.fromString("E100#2"); // Hyper-E: 10^10^100 (googolplex)
38
+ const f = MetaNum.fromString("GF^2 E^3 123"); // letter notation
39
+ const g = MetaNum.fromString("Aa100"); // letter notation
40
+ const h = MetaNum.fromString("[[10], [1, 3]]"); // bracket notation
41
+
42
+ // From an array
43
+ const i = MetaNum.fromArray([2.71828, 1, 2]); // [[3.14, 1, 2]]
44
+ const j = MetaNum.fromArray([10], 1, 1); // layer 1
45
+
46
+ // From an object / JSON
47
+ const k = MetaNum.fromJSON('{"sign":1,"array":[[428571]],"layer":0}');
48
+ const l = MetaNum.fromObject({ sign: 1, array: [[1, 2]], layer: 0 });
49
+
50
+ // From BigInt
51
+ const m = MetaNum.fromBigInt(10n ** 100n);
52
+
53
+ // From Hyper-E notation
54
+ const n = MetaNum.fromHyperE("EE100");
55
+ ```
56
+
57
+ ## Constants
58
+
59
+ ```javascript
60
+ MetaNum.MAX_SAFE_INTEGER // 9007199254740991
61
+ MetaNum.E // log10(MSI)=15.954589770191
62
+ MetaNum.POSITIVE_INFINITY // Infinity
63
+ MetaNum.NEGATIVE_INFINITY // -Infinity
64
+ MetaNum.GRAHAMS_NUMBER // Graham's number (approximation)
65
+ MetaNum.TRITRI // 3↑↑↑3 = 3^^^3
66
+ MetaNum.QqQe308 // QqQe308 (for incremental games)
67
+ ```
68
+
69
+ ## Basic Usage
70
+
71
+ ```javascript
72
+ // Arithmetic
73
+ const sum = MetaNum.add(15, 27); // 42 (static)
74
+ const diff = new MetaNum(27).sub(15); // 12 (instance)
75
+ const product = new MetaNum(15).mul(27); // 405
76
+ const quotient = new MetaNum(27).div(15); // 1.8
77
+
78
+ // Power & roots
79
+ new MetaNum(2).pow(10); // 1024
80
+ new MetaNum(100).sqrt(); // 10
81
+ new MetaNum(27).cbrt(); // 3
82
+ new MetaNum(8).root(3); // 2
83
+ new MetaNum(10).exp(); // e^10
84
+
85
+ // Logarithms
86
+ new MetaNum(100).log10(); // 2
87
+ new MetaNum(8).log(2); // 3
88
+ new MetaNum(Math.E).ln(); // 1
89
+
90
+ // Comparison
91
+ const x = new MetaNum(10), y = new MetaNum(20);
92
+ x.lt(y); // true
93
+ x.gt(y); // false
94
+ x.eq(y); // false
95
+ x.lte(y); // true
96
+ x.gte(y); // false
97
+ x.neq(y); // true
98
+ x.min(y); // 10
99
+ x.max(y); // 20
100
+
101
+ // Comparison with tolerance
102
+ x.eq_tolerance(new MetaNum(10.0001), 1e-3); // true
103
+ x.cmp_tolerance(y, 1e-7); // -1
104
+
105
+ // Sign checks
106
+ x.ispos(); // true
107
+ x.isneg(); // false
108
+ x.isNaN(); // false
109
+ x.isFinite(); // true
110
+ x.isint(); // true
111
+
112
+ // Rounding
113
+ new MetaNum(3.7).floor(); // 3
114
+ new MetaNum(3.2).ceil(); // 4
115
+ new MetaNum(3.5).round(); // 4
116
+
117
+ // Reciprocal & absolute
118
+ new MetaNum(4).rec(); // 0.25
119
+ new MetaNum(-5).abs(); // 5
120
+ new MetaNum(5).neg(); // -5
121
+
122
+ // Factorial & Gamma
123
+ new MetaNum(5).fact(); // 120
124
+ new MetaNum(0.5).gamma(); // Γ(0.5) = √π
125
+
126
+ // Modulo
127
+ new MetaNum(10).mod(3); // 1
128
+
129
+ // Lambert W function
130
+ new MetaNum(1).lambertw(); // Ω ≈ 0.5671
131
+ ```
132
+
133
+ ## Hyper-Operations (Tetration & Beyond)
134
+
135
+ ```javascript
136
+ // Tetration: a^^b
137
+ new MetaNum(2).tetr(3); // 2^^3 = 2^2^2 = 16
138
+ new MetaNum(2).tetr(4); // 2^^4 = 65536
139
+ MetaNum.tetr(2, 5); // 2^^5
140
+
141
+ // With payload (offset)
142
+ new MetaNum(10).tetr(2, new MetaNum(5)); // 10^^2 with payload 5
143
+
144
+ // Pentation: a^^^b
145
+ new MetaNum(2).pent(3); // 2^^^3
146
+
147
+ // General arrow notation: a↑^n b
148
+ new MetaNum(2).arrow(3)(4); // 2↑↑↑4 (pentation)
149
+ MetaNum.arrow(3, 4, 3); // 3↑↑↑↑3 = g_1
150
+
151
+ // Chain notation
152
+ new MetaNum(2).chain(4, 3); // 2→4→3
153
+
154
+ // Aperiation: a↑^a a
155
+ new MetaNum(2).aper(3); // 2↑↑↑2 = 4
156
+ ```
157
+
158
+ ## Super-logarithm & Super-root
159
+
160
+ ```javascript
161
+ // Super-logarithm (inverse of tetration)
162
+ new MetaNum(16).slog(2); // slog_2(16) = 3
163
+ new MetaNum(65536).slog(); // slog_10(65536) ≈ 2
164
+
165
+ // Super-square-root
166
+ new MetaNum(27).ssrt(); // ssqrt(27)
167
+
168
+ // Linear super-root
169
+ new MetaNum(100).linear_sroot(3); // ³ss̅r̅t̅(100)
170
+
171
+ // Layer arithmetic
172
+ new MetaNum(10).layeradd(3); // add 3 layers of exponentiation
173
+ new MetaNum(10).layeradd10(3); // 10^^3 (explicit base 10)
174
+ ```
175
+
176
+ ## Hyper-Operations up to ε₀
177
+
178
+ These functions represent iterated diagonalizations at increasing ordinal levels from ω to ε₀:
179
+
180
+ ```javascript
181
+ const x = new MetaNum(10);
182
+
183
+ // Level ω: diagonalize ω*y (→ a↑^a a)
184
+ x.aperiote(3); // aper(3) = h10
185
+
186
+ // Level ω+1: iterate aperiote
187
+ x.expande(3); // expa(3) = h11
188
+
189
+ // Level ω+2: iterate expande
190
+ x.multiexpande(3); // muea(3) = h12
191
+
192
+ // Level ω+3: iterate multiexpande
193
+ x.powerexpande(3); // poea(3) = h13
194
+
195
+ // Level ω*2: diagonalize ω+y
196
+ x.aperioexpande(3); // apea(3) = h20
197
+
198
+ // Level ω*2+1: iterate aperioexpande
199
+ x.explode(3); // expl(3) = h21
200
+
201
+ // Level ω*2+2: iterate explode
202
+ x.multiexplode(3); // muel(3) = h22
203
+
204
+ // Level ω*3: diagonalize ω*2+y
205
+ x.aperioexplode(3); // apel(3) = h30
206
+
207
+ // Level ω*3+1: iterate aperioexplode
208
+ x.detonate(3); // deto(3) = h31
209
+
210
+ // Level ω*4: diagonalize ω*3+y
211
+ x.aperiodetonate(3); // apdt(3) = h40
212
+
213
+ // Level ω^2: diagonalize ω*y
214
+ x.aperionate(3); // apeo(3) = h100
215
+
216
+ // Level ω^2+1: iterate aperionate
217
+ x.megote(3); // mego(3) = h101
218
+
219
+ // Level ω^2+2: iterate megote
220
+ x.multimegote(3); // mume(3) = h102
221
+
222
+ // Level ω^2+ω: diagonalize ω^2+y
223
+ x.aperimegote(3); // apmg(3) = h110
224
+
225
+ // Level ω^2+ω+1: iterate aperimegote
226
+ x.megoexpande(3); // mgea(3) = h111
227
+
228
+ // Level ω^2+ω*2: diagonalize ω^2+ω+y
229
+ x.aperimegoexpande(3); // apme(3) = h120
230
+
231
+ // Level ω^2*2: diagonalize ω^2+ω*y
232
+ x.megoaperionate(3); // mgao(3) = h200
233
+
234
+ // Level ω^2*2+1: iterate megoaperionate
235
+ x.gigote(3); // gigo(3) = h201
236
+
237
+ // Level ω^2*2+ω: diagonalize ω^2*2+y
238
+ x.aperigigote(3); // apgg(3) = h210
239
+
240
+ // Level ω^2*3: diagonalize ω^2*2+ω*y
241
+ x.gigoaperionate(3); // ggap(3) = h300
242
+
243
+ // Level ω^3: diagonalize ω^2*y
244
+ x.aperiatote(3); // apat(3) = h1000
245
+
246
+ // Level ω^3+1: iterate aperiatote
247
+ x.powiainate(3); // pwan(3) = h1001
248
+
249
+ // Level ω^3+ω: diagonalize ω^3+y
250
+ x.expandainate(3); // epan(3) = h1010
251
+
252
+ // Level ω^3+ω^2: diagonalize ω^3+ω*y
253
+ x.megodainate(3); // mgan(3) = h1100
254
+
255
+ // Level ω^3*2: diagonalize ω^3+ω^2*y
256
+ x.powiairate(3); // pwar(3) = h2000
257
+
258
+ // Level ω^4: diagonalize ω^3*y
259
+ x.aperioguate(3); // apgu(3) = h10000
260
+
261
+ // Level ω^ω: diagonalize ω^x (layer 1 transition)
262
+ x.iterate(3); // iter(3) = hww
263
+
264
+ // Level ω^ω+1: iterate ω^ω level operations
265
+ x.itermult(3); // itmu(3) = hw01
266
+
267
+ // Level ω^ω*2: (ω^ω)*2 = ω^ω + ω^base
268
+ x.cuboiter(3); // cube(3) = hwx2
269
+
270
+ // Level ω^(ω+1): ω^(ω+1) = ω^ω*ω → ω^(ω*y)
271
+ x.expoiter(3); // expo(3) = hwa1
272
+
273
+ // Level ω^(ω*2): ω^(ω*2) = ω^(ω+base)
274
+ x.trioterate(3); // tria(3) = hwm2
275
+
276
+ // Level ω^(ω^2): diagonalize ω^(ω*y) (layer 2)
277
+ x.trixxate(3); // trix(3) = hwp2
278
+
279
+ // Level ω^(ω^ω): diagonalize ω^(ω^y) (layer 3)
280
+ x.aperixxate(3); // apix(3) = hwpw
281
+
282
+ // Level ε₀ = ω↑↑ω: diagonalize ω↑↑y (layer 4)
283
+ x.epsilonate(3); // epsl(3) = hepsl
284
+ ```
285
+
286
+ ## Inverse Operations
287
+
288
+ Each expansion operation has a corresponding inverse for decrementing ordinal structure:
289
+
290
+ ```javascript
291
+ x.i_aper(z) // i10 = inverse of aperiote
292
+ x.i_expa(z) // i11 = inverse of expande
293
+ x.i_muea(z) // i12 = inverse of multiexpande
294
+ x.i_poea(z) // i13 = inverse of powerexpande
295
+ x.i_apea(z) // i20 = inverse of aperioexpande
296
+ x.i_expl(z) // i21 = inverse of explode
297
+ x.i_muel(z) // i22 = inverse of multiexplode
298
+ x.i_apel(z) // i30 = inverse of aperioexplode
299
+ x.i_deto(z) // i31 = inverse of detonate
300
+ x.i_apdt(z) // i40 = inverse of aperiodetonate
301
+ x.i_apeo(z) // i100 = inverse of aperionate
302
+ x.i_mego(z) // i101 = inverse of megote
303
+ x.i_mume(z) // i102 = inverse of multimegote
304
+ x.i_apmg(z) // i110 = inverse of aperimegote
305
+ x.i_mgea(z) // i111 = inverse of megoexpande
306
+ x.i_apme(z) // i120 = inverse of aperimegoexpande
307
+ x.i_mgao(z) // i200 = inverse of megoaperionation
308
+ x.i_gigo(z) // i201 = inverse of gigote
309
+ x.i_apgg(z) // i210 = inverse of aperigigote
310
+ x.i_ggap(z) // i300 = inverse of gigoaperionate
311
+ x.i_apat(z) // i1000 = inverse of aperiatotion
312
+ x.i_pwan(z) // i1001 = inverse of powiainate
313
+ x.i_epan(z) // i1010 = inverse of expandainate
314
+ x.i_mgan(z) // i1100 = inverse of megodainate
315
+ x.i_pwar(z) // i2000 = inverse of powiairate
316
+ x.i_apgu(z) // i10000 = inverse of aperioguate
317
+ x.i_iter(z) // iww = inverse of iter
318
+ x.i_itmu(z) // iw01 = inverse of itermult
319
+ x.i_cube(z) // iwx2 = inverse of cuboiter
320
+ x.i_expo(z) // iwa1 = inverse of expoiter
321
+ x.i_tria(z) // iwm2 = inverse of trioterate
322
+ x.i_trix(z) // iwp2 = inverse of trixxate
323
+ x.i_apix(z) // iwpw = inverse of aperixxate
324
+ x.i_epsl(z) // iepsl = inverse of epsilonate
325
+ ```
326
+
327
+ ## BEAF Operations
328
+
329
+ Bowers' Exploding Array Function (BEAF) is supported via ordinal arithmetic for 3+ arguments:
330
+
331
+ ```javascript
332
+ // BEAF(a,b,c,d,e,f,...) = a{...+ω^3*(f-1)+ω^2*(e-1)+ω*(d-1)+(c-1)}b
333
+
334
+ // 3-entry: {a,b,c} = a↑^c b (standard up-arrow notation)
335
+ MetaNum.BEAF(3, 3, 2); // 3↑↑3 = 7625597484987
336
+ MetaNum.BEAF(3, 3, 3); // 3↑↑↑3 = tritri
337
+
338
+ // 4-entry: {a,b,c,d} = a(ω*d+c level operation)b
339
+ MetaNum.BEAF(2, 2, 1, 2); // 2{ω}2
340
+ MetaNum.BEAF(3, 3, 3, 3); // 3{ω*2+2}3
341
+
342
+ // 5+ entry: ordinal arithmetic
343
+ MetaNum.BEAF(10, 2, 1, 1, 2); // 10{ω^2}2
344
+ MetaNum.BEAF(3, 3, 3, 3, 2); // 3{ω^2+ω+1}3
345
+ MetaNum.BEAF(4, 5, 6, 7, 8, 9); // 4{ω^3*8+ω^2*7+ω*6+5}5
346
+
347
+ // nested BEAF: {a,{b,c,d,e},f,g,h}
348
+ // An argument exceeding MSI supremum-collapses (use fundamental sequences rules):
349
+ // ω*i+HUGE ≈ ω*(i+1), ω^i*HUGE ≈ ω^(i+1), etc.
350
+ // (lower coefficients are swallowed), and the result anchors at that argument's value.
351
+ MetaNum.BEAF(4, MetaNum.BEAF(4, 2, 3, 5), 3, 5); // 4{ω*4+2}4{ω*4+2}2
352
+
353
+ // Parse BEAF string notation
354
+ MetaNum.fromBeaf("{3,3,3}"); // 3↑↑↑3
355
+ MetaNum.fromBeaf("{3,3,3,3}"); // 3{ω*2+2}3
356
+ MetaNum.fromBeaf("{10,2,1,1,2}"); // 10{ω^2}2
357
+
358
+ // Convert to BEAF string
359
+ new MetaNum(7625597484987).toBeaf(); // "{7625597484987}"
360
+ MetaNum.BEAF(3,3,3).toBeaf(); // "{3638334640023.7783}"
361
+ ```
362
+
363
+ ## Layer & Serialization
364
+
365
+ ```javascript
366
+ // Layer manipulation
367
+ new MetaNum(10).layerUp(); // promote to layer+1
368
+ new MetaNum(10).layerDown(); // demote to layer-1
369
+
370
+ // Output formats
371
+ new MetaNum(123).toString(); // "123"
372
+ new MetaNum(1e308).toString(); // "E308"
373
+ new MetaNum(100).toNumber(); // 100
374
+ new MetaNum(100).valueOf(); // "100"
375
+ new MetaNum(100).toFixed(2); // "100.00"
376
+ new MetaNum(100).toExponential(2); // "1.00e+2"
377
+ new MetaNum(100).toPrecision(3); // "100"
378
+ new MetaNum(100).toHyperE(); // "100"
379
+ new MetaNum(100).toStringWithDecimalPlaces(4); // "100.0000"
380
+ new MetaNum(100).toJSON(); // {sign:1, array:[[100]], layer:0}
381
+ ```
382
+
383
+ ## Utility Functions
384
+
385
+ ```javascript
386
+ // Binomial coefficient
387
+ new MetaNum(10).choose(3); // C(10,3) = 120
388
+
389
+ // Hyper-operation
390
+ MetaNum.hyper(4, 2, 3); // 2^^3 = 16 (n=4 means tetration)
391
+
392
+ // Geometric series
393
+ MetaNum.sumGeometricSeries(5, 1, 2); // 1+2+4+8+16 = 31
394
+ MetaNum.affordGeometricSeries(100, 1, 2, 0);
395
+
396
+ // Arithmetic series
397
+ MetaNum.sumArithmeticSeries(5, 1, 2); // 1+3+5+7+9 = 25
398
+ MetaNum.affordArithmeticSeries(100, 1, 2, 0);
399
+
400
+ // Configuration
401
+ MetaNum.config({ maxRows: 50, maxCols: 50, maxArrow: 1e6, debug: 1 });
402
+ ```
403
+
404
+ # Mathematical Background
405
+
406
+ The library implements the extended arrow operation which is a hierarchy of functions indexed by ordinal numbers. The representation uses Cantor normal form for ordinals, where:
407
+
408
+ - ω represents the first infinite ordinal
409
+ - ω^ω represents ω raised to the power of ω
410
+ - ε₀ is the limit of ω, ω^ω, ω^ω^ω, ...
411
+
412
+ For more information, see: <https://en.wikipedia.org/wiki/Ordinal_arithmetic>
413
+
414
+ ## Definition
415
+
416
+ Let n and b be natural numbers, and α be a countable ordinal
417
+
418
+ - rule 1: If α=0, n{α}b=n×b
419
+ - rule 2: If α is a successor ordinal, then n{α}b =n if b=1, =n{α-1}n{α}(b-1) if b>1
420
+ - rule 3: If α is a limit ordinal, then n{α}b=n{α\[b]}n
421
+ - rule 4: Operations are calculated from right to left
422
+
423
+ where α\[b] denotes the b-th element of the fundamental sequence assign to the limit ordinal of α, see also fundamental sequences for limit ordinals written in Cantor normal form:
424
+
425
+ - ω\[n]=n
426
+ - ω^(α+1)\[n]=ω^α×n where ω^α×n=ω^α+ω^α+...+ω^α with n ω^α's
427
+ - ω^α\[n]=ω^(α\[n]) if and only if α is a limit ordinal
428
+ - (ω^(α_1)+ω^(α_2)+...+ω^(α_k))\[n]=ω^(α_1)+ω^(α_2)+...+ω^(α_k)\[n], where α_1>=α_2>=...>=α_k
429
+ - ε₀\[0]=1 and ε₀\[n+1]=ω^ε₀\[n]
430
+
431
+ ## Examples
432
+
433
+ 642663{0}178187=642663×178187=114514191981
434
+
435
+ 10{1}5=10{0}10{1}4=10{0}10{0}10{1}3=10{0}10{0}10{0}10{1}2=10{0}10{0}10{0}10{0}10{1}1=10×10×10×10×10=10^5=100000
436
+
437
+ 10{2}4=10{1}10{2}3=10{1}10{1}10{2}2=10{1}10{1}10{1}10{2}1=10{1}10{1}10{1}10=10^(10^(10000000000))
438
+
439
+ 10{3}3=10{2}10{2}10=10{2} 9(10{1})'s 10=10↑↑(10^10^10^10^10^10^10^10^10000000000)
440
+
441
+ 3{ω}5=3{5}5=3{4}3{4}3{4}3{4}3=3{4}3{4}3{4}3{3}3{3}3=3{4}3{4}3{4}3{3}3{2}3{2}3=3{4}3{4}3{4}3{3}3{2}3{1}3{1}3=3↑↑↑↑3↑↑↑↑3↑↑↑↑3↑↑↑3↑↑7625597484987
442
+
443
+ 5{ω+1}4=5{ω}5{ω+1}3=5{ω}5{ω}5{ω+1}2=5{ω}5{ω}5{ω}5{ω+1}1=5{ω}5{ω}5{ω}5=5{ω}5{ω}5{5}5=5{ω}5{5{5}5}5=5{5{5{5}5}5}5
444
+
445
+ 4{ω+2}3=4{ω+1}4{ω+1}4=4{ω+1}4{ω}4{ω}4{ω}4=4{ω+1}4{4{4{4}4}4}4=4{ω}4{ω}... with 4{4{4{4}4}4}4 4's
446
+
447
+ 10{ω×2}10=10{ω+10}10=9(10{ω+9})'s 10=8(10{ω+9})'s 9(10{ω+8})'s 10=8(10{ω+9})'s 8(10{ω+8})'s ... 8(10{ω+1})'s 8(10{ω})'s 8(10{9})'s ... 8(10{1})'s 10000000000
448
+
449
+ 10{ω^2}4=10{ω×4}4=10{ω×3+4}4=10{ω×3+3}10{ω×3+3}10{ω×3+3}10=10{ω×3+3}10{ω×3+3} 8(10{ω×3+2})'s 8(10{ω×3+1})'s 8(10{ω×3})'s 8(10{ω×2+9})'s ... 8(10{ω×2})'s ... 8(10{ω})'s ... 8(10{1})'s 10000000000
450
+
451
+ 10{ω^ω}4=10{ω^4}4=10{ω^3×4}4=10{ω^3×3+ω^3}4=10{ω^3×3+ω^2×4}4=...=10{ω^3×3+ω^2×3+ω×3+4}4=3(10{ω^3×3+ω^2×3+ω×3+3})'s 10=2(10{ω^3×3+ω^2×3+ω×3+3})'s 8(10{ω^3×3+ω^2×3+ω×3+2})'s 8(10{ω^3×3+ω^2×3+ω×3+1})'s ... 8(10{1})'s 10000000000
452
+
453
+ 10{ω^(ω^2)}4=10{ω^(ω×ω)}4=10{ω^(ω×4)}4=10{ω^(ω×3+4)}4=10{ω^(ω×3+3)×ω}4=10{ω^(ω×3+3)×4}4=10{ω^(ω×3+3)×3+ω^(ω×3+2)×3+ω^(ω×3+1)×3+...+ω^2×3+ω×3+4}4
454
+
455
+ 10{ε₀}4=10{ω^(ω^(ω^ω))}4=10{ω^(ω^(ω^4))}4=10{ω^(ω^(ω^3×3+ω^2×3+ω×3+4))}4=10{ω^(ω^(ω^3×3+ω^2×3+ω×3+3)×3+ω^(ω^3×3+ω^2×3+ω×3+2)×3+...++ω^2×3+ω×3+4)}4
456
+
457
+ # dlsdl's Letter Notation
458
+
459
+ Modified from PsiCubed's letter notation(<https://googology.fandom.com/wiki/User_blog:PsiCubed2/My_Letter_Notation>)
460
+
461
+ The idea here is to extend the PsiCubed's letter notation to much larger numbers reach level ε0 of FGH or HH. The properties we wish to preserve here are:
462
+
463
+ (1) Any number has a unique standard representation in the system.
464
+
465
+ (2) Given the standard representation of two numbers, one can immediately tell which one is larger without any calculations.
466
+
467
+ ## The format of the proposed notation
468
+
469
+ Our final notation will look like this:
470
+
471
+ \[symbol]\[letter]\[number]
472
+
473
+ where \[symbol] can be one of the following: empty,!,@,#,$,%,&,……
474
+
475
+ where \[letter] can be one of the following: E,F,G,H,……,Aa,Ab,Ac,……,Ba,Bb,……,Aaa,……
476
+
477
+ and \[number] can be any positive real number (nonintegers included).
478
+
479
+ ## Single letter notation
480
+
481
+ ### The First Levels: A Continuous version of Knuth Arrows
482
+
483
+ We'll define:
484
+
485
+ Eα = 10^α = 10{1}α
486
+
487
+ Fα = EEEE...EEE(10^frac(α)) with int(α) E's = 10{2}α
488
+
489
+ Gα = FFFF...FFF(10^frac(α)) with int(α) F's = 10{3}α
490
+
491
+ Hα = GGGG...GGG(10^frac(α)) with int(α) G's = 10{4}α
492
+
493
+ then we'll have I,J,K,... to Z ,each with the same definition as Hα.
494
+
495
+ Note that according to these definitions we have:
496
+
497
+ (1) For α≤1: Eα = Fα = Gα = Hα = ... = Zα = 10^α
498
+
499
+ (2) For any integer β: Eβ = 10{1}β, Fβ = 10{2}β, Gβ = 10{3}β, Hβ = 10{4}β
500
+
501
+ the γ-th letter β represents 10(γ-4 arrows)β = 10{γ-4}β
502
+
503
+ So the above definitions are indeed an extention of Knuth arrows to nonintegers.
504
+
505
+ ### Letter-Canonical Forms
506
+
507
+ If α is a number greater than 1 and Γ is a one of the letters E,F,G,H,...,ζ then there is a unique number β such that:
508
+
509
+ α = Γβ.
510
+
511
+ And we call "Γβ" the Γ-Canonical Form of the number α.
512
+
513
+ For example, the E-Canonical form of 1000 is E3:
514
+
515
+ E3 = 10^3 = 1000.
516
+
517
+ And the F-Canonical form of 1000 is about F1.47712:
518
+
519
+ F1.47712 = E(10^0.47712) ≈ E3 = 10^3 = 1000.
520
+
521
+ ### Binary-Letter-Canonical Forms
522
+
523
+ To recreate ordinary scientific notation, we'll define a binary version of the letter functions like this:
524
+
525
+ Let Γ be one of the letters E,F,G,H,...,ζ Let β be a nonnegative integer and α be a real number between 1 and 10. Then:
526
+
527
+ αΓβ = Γ(β+log(α))
528
+
529
+ For Example:
530
+
531
+ 7E3 = E(3+log(7)) = 10^(3+log(7)) = 7\*10^3 = 7000
532
+
533
+ 7F3 = F(3+log(7)) = EEE(10^log(7)) = EEE7 = 10^10^10^7
534
+
535
+ So αEβ is nothing more than ordinary scientific notation.
536
+
537
+ And αFβ is a power tower of β 10's topped by an α.
538
+
539
+ And again, given any specific letter (E,F,G,H,...,ζ), ANY number greater than 1 has a unique representation as αΓβ (with 1≤α<β). So we can call this the Binary-Γ-Canonical Form of α.
540
+
541
+ ## Multi letter notation
542
+
543
+ ### Defining Aa - The First Diagonalization
544
+
545
+ In the previous section we've defined an infinite sequence of functions, so we can diagonalize over them:
546
+
547
+ let 1|α = Eα, 2|α = Fα, 3|α = Gα, ..., 22|α = Zα.
548
+
549
+ we had: Aaα = α|10 = 10{α}10.
550
+
551
+ So Aa is comparable to f\_ω\_(n) in the FGH.
552
+
553
+ But there are a couple of problems here:
554
+
555
+ (1) α|10 isn't yet defined for noninteger α.
556
+
557
+ (2) Aa1 would be 1|10 = 10^10 rather than 10 = E1 = F1 = G1 =...= Z1. This would have caused trouble later on, when we define the higher levels.To solve these two problems, we'll give a definition for α|10 and amend the definition of Aa:
558
+
559
+ (i) α|10 = (int(α)+1)|2\*5^frac(α)
560
+
561
+ (ii) For α<2: Aaα = Gα
562
+
563
+ (iii) For α≥2: Aaα = α|10
564
+
565
+ The seemingly complex expression in rule (i) simply gives us a smooth geometric curve between 2 and 10. This ensures that Aa would be continuous, given the identity 10↑(β)10 = 10↑(β+1)2.
566
+
567
+ ### Ab,Ac,Ad,...,Az and their Universal Canonical Forms
568
+
569
+ The definitions of Ab,Ac,Ad,...,Az are simple enough:
570
+
571
+ Abα = AaAa...AaAa(10^frac(α)) with int(α) Aa's
572
+
573
+ Acα = AbAb...AbAb(10^frac(α)) with int(α) Ab's
574
+
575
+ then we have Ad,Ae,...,Az, each with the same definition as Ab and Ac.
576
+
577
+ And that's it. So A(the β+1-th letter) is comparable to f\_ω+β\_(n) in the FGH.
578
+
579
+ Again we have Ab0=Ac0=Ad0=...=Az0=1, Ab1=Ac1=Ad1=...=Az1=10, and Ab,Ac,Ad,...,Az are all continuous. So any number greater than 1 has a unique Ab to Az Canonical Form.
580
+
581
+ Moreover, since Aa10=Ab2 and Ab10=Ac2, we can extend our definition of the "Universal Canonical Form" up to Az10:
582
+
583
+ (1) if α<100 (that's E2) then we write down the E-Canonical Form of α.
584
+
585
+ (2) Otherwise, we write α as Γβ for some letter combinations Γ and 2≤β<10. If there is more than one possible choice, we choose the letter combination which comes first in order.
586
+
587
+ ### Defining from Ba to Bz
588
+
589
+ We already know how to do recursion (F,G,H,I,...,ζ) and simple diagonalization (Aa) in our continuous system, so we can easily extend our system up to ω×2-level in the FGH. In order to track our progress, we'll use the format (1,β)|α and define:
590
+
591
+ (1,0)|α = Aaα
592
+
593
+ (1,β+1)|α = (1,β)|(1,β)|...|(1,β)|10^frac(α) with int(α) (1,β)'s
594
+
595
+ And define Baα in a way similar to Aaα:
596
+
597
+ (i) (1,α)|10 = (1,int(α)+1)|2\*5^frac(α)
598
+
599
+ (ii) For α<2: Baα = (1,3)|α
600
+
601
+ (iii) For α≥2: Baα = (1,α)|10
602
+
603
+ This gives rise to writing numbers in Ba-Canonical form and extend the Universal Canonical Form up to Ba10 ,which is about f\_ω×2\_(10) in the FGH.
604
+
605
+ Then we can define Bb,Bc, Bd,...,Bz with recursions in a similar way. Bbα = BaBa...BaBa(10^frac(α)) with int(α) Ba's, and Bcα = BbBb...BbBb(10^frac(α)) with int(α) Bb's, etc. B(the β+1-th letter) is comparable to f\_ω\*2+β\_(n) in the FGH.
606
+
607
+ ### A Supporting Array Notation and Aaa
608
+
609
+ We can, of-course, repeat what we did in the previous section as many times as we wish and get the following ω^2-level notation (β,γ ≥ 0 are integers, and α≥0 is real):
610
+
611
+ (i) (0,1)|α = 10^α
612
+
613
+ (ii) (β,γ+1)|α = (β,γ)|(β,γ)|...|(β,γ)|10^frac(α) with int(α) (β,γ)'s
614
+
615
+ (iii) (β,α)|10 = (β,int(α)+1)|2\*5^frac(α)
616
+
617
+ (iv) For α<2: (β+1,0)|α = (β,3)|α
618
+
619
+ (v) For α≥2: (β+1,0)|α = (β,α)|10
620
+
621
+ Note that (β,γ) is comparable to f\_ω\*β+γ\_(α) in the FGH. Also, if we read (0,γ)|α as γ|α, this notation is a direct extension of everything we did before this section. Also, in this new notation we can write Baα = (2,0)|α, Bbα = (2,1)|α,... Bzα = (2,25)|α.
622
+
623
+ So QqQe308=10{ω17+16}10{ω17+4}308 is about f\_ω17+16\_(f\_ω17+4\_(308)).
624
+
625
+ And with this new supporting notation we can now to define Aaaα:
626
+
627
+ (i) For α<2: Aaaα = (2,1)|α
628
+
629
+ (ii) For α≥2: Aaaα = (int(α),10\*frac(α))|10
630
+
631
+ With rule (ii) containing a very neat trick that allows us to do the double-diagonalization with a single number: Aaa1.5 = (2,1)|1.5, Aaa2.5 = (2,5)|10
632
+
633
+ At any rate, it isn't too difficult to see that Aaa behaves "nicely" and allows us to speak of Aaa-Canonical Forms of any number. And since Aaa2=Ba10, Aaa3=Ca10,..., Aaa26=Za10, this also enables us to write the Unversal Canonical Form of any number about f\_ω^2\_(10) in the FGH.
634
+
635
+ ## Symbol and letter notation
636
+
637
+ ### Arrays with more than two variable, and !Aa
638
+
639
+ Array notations can be easily extended to a multivariable array notation, like so:
640
+
641
+ (i) For α≤1: (anything)|α = 10^α
642
+
643
+ (ii) (β,γ,δ,...,ν+1)|α = (β,γ,δ,...,ν)|(β,γ,δ,...,ν)|...|(β,γ,δ,...,ν)|10^frac(α) with int(α) (β,γ,δ,...,ν)'s
644
+
645
+ (iii) (β,γ,δ,...,ν,α)|10 = (β,γ,δ,...,ν,int(α+1))|2\*5^frac(α)
646
+
647
+ (iv) For 1<α<2: (β,γ,δ,...,μ+1,<κ zeros>)|α = (β,γ,δ,...,μ,2,<κ-1 zeros>)|10^(α-1)
648
+
649
+ (v) For α≥2: (β,γ,δ,...,μ+1,<κ zeros>)|α = (β,γ,δ,...,μ,α,<κ-1 zeros>)|10
650
+
651
+ (vi) (β,γ,δ,...,α,<κ zeros>)|10 = (β,γ,δ,...,int(α),frac(α)\*10,<κ-1 zeros>)|10
652
+
653
+ (vii) (0,...,0,β,γ,δ,...,μ)|α = (β,γ,δ,...,μ)|α
654
+
655
+ The first 5 rules are a simple and direct extention of the 2-variable arrays notation, and Rule vii simply states that leading zeros can be ommitted.
656
+
657
+ Rule vi is an interesting one, though. It basically tells us that if we have an array which ends with (...,α,0,0,...,0) then the digits of the fractional part of α are to be distributed among the zeros. For example:
658
+
659
+ - (114,514,1.9198,0,0,0,0)|10 = (114,514,1,9,1,9,8)|10.
660
+
661
+ Now, all that is left to do is to define !Aa, which is about f\_ω^ω\_(10) in the FGH.
662
+
663
+ For α<2: !Aaα = (1,0,1)|α
664
+
665
+ For α≥2: !Aaα = (10^frac(α),0,...,0)|10 with int(α) zeros.
666
+
667
+ Then we have !Aa2 = Aaa10, !Aa3 = Aaaa10,... Just like the previous letters, any number can be written as !Aaα. Here, it is actually the binary form of α!Aaβ = !Aa(β+logα) which has the most intuitive meaning for β≥2:
668
+
669
+ In terms of the array notation, β+1 tells us how many numbers are in the array and the digits of α tell us the what those numbers are. For example: 1.2345!Aa4 = (1,2,3,4,5)|10
670
+
671
+ And in terms of FGH ordinals, β gives us the maximum power of ω and the digits of α give us the coefficents of the various powers of ω: 1.2345!Aa4 \~ f\_ω^4+ω^3\*2+ω^2\*3+ω\*4+5\_(10). Actually, these neat relations are also true for β=1 and α≥2, so 2.5!Aa1 = (2,5)|10.
672
+
673
+ ### Higher dimensional arrays and @Aa
674
+
675
+ With the definition of the array notation and the symbol !, one can easily define palanar array notation function. In this notation, the comma is short for \[0], and the dimensional seperator is \[1], ζ's represent 0's and dimensional seperators (or can be empty) and κ zeroes. κ+1 zerores means a group of zeroes and dimensional seperators starting with at least 1 zero. κ zeroes is that but it doesn't need to start with a zero.
676
+
677
+ (i) Other rules are the same from linear array notation
678
+
679
+ (ii) (β,γ,δ,...,μ+1\[1]0,ζ)|α = (β,γ,δ,...,μ\[1]1,0,0,ζ)|10^(x-1) for 1\<x<2
680
+
681
+ (iii) (β,γ,δ,...,μ+1\[1]0,ζ)|α = (β,γ,δ,...,μ\[1]10^frac(x),0,...,0,ζ)|10 with int(x) 0's for x=>2
682
+
683
+ (iv) (β,γ,δ,...,α\[1]0,ζ)|10, κ = frac(α)\*10
684
+
685
+ It equals to (β,γ,δ,...,int(α)\[1]10^frac(κ),0,...,0,ζ)|10 with int(κ) 0's where κ >=1 or there is only 1 \[1] and there is a 1 before it, or (β,γ,δ,...,int(α)\[1]frac(κ),ζ)|10 otherwise
686
+
687
+ (v) (...\[1]0,...,0,β,γ...)|α = (...\[1]β,γ...)|α
688
+
689
+ Rule 2 and 3 are the case where the last nonzero entry is at the end of a plane and is an integer. Rule 4 is when the last nonzero entry is at the end of a plane, you use the fractional part of the last entry, and put it in the next row.
690
+
691
+ By adding ! before a letter notation, it changes from HH to FGH. Aa represents H\_ω, so !Aa represents f\_ω which equals to H\_ω^ω. Then we can define !Ab (f\_ω^(ω+1)_(10) in FGH), !Ac, !Ad,..., !Az with the same meaning as !Aa, and !Ba(f\_ω^(ω2)_(10) in FGH), !Bb, !Bc, ..., !Bz, !Aaa, etc. Comparing these with the previous letters, we can see that notations with ! symbol have a more ω^ in FGH than those without ! symbol.
692
+
693
+ Fractional number of rows, columns, etc.. are defined in the same way as in the linear array notation, \[0] is the comma. ζ is an array of 0's and dimensional seperators.
694
+
695
+ For level comparison, first compare the levels of the highest-leveled seperators. If they are equal, then compare the number of highest-leveled subseperators. If there are the same number, compare everything in the seperator after the last occurance of the highest-leveled seperator in a seperator. If they are equal, do that with the string before the last ocurrence of the highest-leveled seperator. If they are the same, the seperators have the same level.
696
+
697
+ Now, all that is left to do is to define @Aa, which is about f\_ω^ω^ω\_(10) in the FGH.
698
+
699
+ For α<2: @Aaα = (1\[1,0,0]0)|α
700
+
701
+ For α≥2: @Aaα = (1\[10^frac(α),0,...,0]0)|10 with int(α) zeros.
702
+
703
+ ### Nested arrays and more symbols
704
+
705
+ The Definiton of more symbols is similar to the definition of @Aa.
706
+
707
+ \#Aa \~ f\_ω^ω^ω^ω\_(10)
708
+
709
+ \$Aa \~ f\_ω^ω^ω^ω^ω\_(10)
710
+
711
+ Then we can define (the β-th symbol or symbol combination)Aa = f\_ω^ω^...^ω(β+1 ω's)\_(10)
712
+
713
+ ### Definition of the final letter: ε
714
+
715
+ ε represents exponent tower layers of ω, and it is comparable to f\_ε0\_(10) in the FGH.
716
+
717
+ αεβ \~ f\_ω^ω^...^ω(β ω's)\_(α)
718
+
719
+ #### Using dlsdl's letter notation, the biggest number we can define in Metanum is about ε9.007E15
720
+
721
+ # Changelog
722
+
723
+ - 2026-8-18 v1.4 Support hyper operation >MSI and fix format-metanum bugs
724
+ - 2026-7-31 v1.3 Add format-metanum.js, fix basic operations, hyper operations and BEAF bugs
725
+ - 2026-7-9 v1.2 Add more hyper operations up to ε₀, add BEAF operation and fix bugs
726
+ - 2026-6-3 v1.1 Add support for very small numbers ,add more hyper operations and fix bugs
727
+ - 2026-5-23 v1.0 Rewritten and add even more hyper operations
728
+ - 2026-2-24 v0.4 Add hyper operations and extend fromString
729
+ - 2026-2-11 v0.3 Reconstruct code and correct calculating functions
730
+ - 2026-2-6 v0.2 New Metanum data structure with Cantor normal form
731
+ - 2026-2-1 v0.1 First commit
732
+