metanum 1.2.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,671 +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.2 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) or -1 (negative)
14
- - **layer**: Non-negative integer representing the ω exponent tower height
15
- - **array**: 2-dimensional array `[[r0, e, f, g, ...], [count, level], ...]` where the first row holds the base value and finite hyper-operation exponents, and subsequent rows hold ordinal terms
16
-
17
- ## Installation
18
-
19
- ```bash
20
- npm install metanum
21
- ```
22
-
23
- ## Creating Instances
24
-
25
- ```javascript
26
- // From a plain number
27
- const a = new MetaNum(42);
28
- const b = MetaNum.fromNumber(-3.14);
29
-
30
- // From a string (supports scientific notation, hyper-operations, letter notation, brackets, etc.)
31
- const c = new MetaNum("1.5e308");
32
- const d = MetaNum.fromString("10^^5"); // tetration: 10^^5
33
- const e = MetaNum.fromString("E100#2"); // Hyper-E: 10^10^100 (googolplex)
34
- const f = MetaNum.fromString("GF^2 E^3 123"); // letter notation
35
- const g = MetaNum.fromString("Aa100"); // letter notation
36
- const h = MetaNum.fromString("[[10], [1, 3]]"); // bracket notation
37
-
38
- // From an array
39
- const i = MetaNum.fromArray([3.14, 1, 2]); // [[3.14, 1, 2]]
40
- const j = MetaNum.fromArray([10], 1, 1); // layer 1
41
-
42
- // From an object / JSON
43
- const k = MetaNum.fromJSON('{"sign":1,"array":[[42]],"layer":0}');
44
- const l = MetaNum.fromObject({ sign: 1, array: [[1, 2]], layer: 0 });
45
-
46
- // From BigInt
47
- const m = MetaNum.fromBigInt(10n ** 100n);
48
-
49
- // From Hyper-E notation
50
- const n = MetaNum.fromHyperE("EE100");
51
- ```
52
-
53
- ## Constants
54
-
55
- ```javascript
56
- MetaNum.MAX_SAFE_INTEGER // 9007199254740991
57
- MetaNum.E_
58
- MetaNum.POSITIVE_INFINITY // Infinity
59
- MetaNum.NEGATIVE_INFINITY // -Infinity
60
- MetaNum.GRAHAMS_NUMBER // Graham's number (approximation)
61
- MetaNum.TRITRI // 3↑↑↑3 = 3^^^3
62
- MetaNum.QqQe308 // QqQe308 (for incremental games)
63
- ```
64
-
65
- ## Basic Usage
66
-
67
- ```javascript
68
- // Arithmetic
69
- const sum = MetaNum.add(15, 27); // 42 (static)
70
- const diff = new MetaNum(27).sub(15); // 12 (instance)
71
- const product = new MetaNum(15).mul(27); // 405
72
- const quotient = new MetaNum(27).div(15); // 1.8
73
-
74
- // Power & roots
75
- new MetaNum(2).pow(10); // 1024
76
- new MetaNum(100).sqrt(); // 10
77
- new MetaNum(27).cbrt(); // 3
78
- new MetaNum(8).root(3); // 2
79
- new MetaNum(10).exp(); // e^10
80
-
81
- // Logarithms
82
- new MetaNum(100).log10(); // 2
83
- new MetaNum(8).log(2); // 3
84
- new MetaNum(Math.E).ln(); // 1
85
-
86
- // Comparison
87
- const x = new MetaNum(10), y = new MetaNum(20);
88
- x.lt(y); // true
89
- x.gt(y); // false
90
- x.eq(y); // false
91
- x.lte(y); // true
92
- x.gte(y); // false
93
- x.neq(y); // true
94
- x.min(y); // 10
95
- x.max(y); // 20
96
-
97
- // Comparison with tolerance
98
- x.eq_tolerance(new MetaNum(10.0001), 1e-3); // true
99
- x.cmp_tolerance(y, 1e-7); // -1
100
-
101
- // Sign checks
102
- x.ispos(); // true
103
- x.isneg(); // false
104
- x.isNaN(); // false
105
- x.isFinite(); // true
106
- x.isint(); // true
107
-
108
- // Rounding
109
- new MetaNum(3.7).floor(); // 3
110
- new MetaNum(3.2).ceil(); // 4
111
- new MetaNum(3.5).round(); // 4
112
-
113
- // Reciprocal & absolute
114
- new MetaNum(4).rec(); // 0.25
115
- new MetaNum(-5).abs(); // 5
116
- new MetaNum(5).neg(); // -5
117
-
118
- // Factorial & Gamma
119
- new MetaNum(5).fact(); // 120
120
- new MetaNum(0.5).gamma(); // Γ(0.5) = √π
121
-
122
- // Modulo
123
- new MetaNum(10).mod(3); // 1
124
-
125
- // Lambert W function
126
- new MetaNum(1).lambertw(); // Ω ≈ 0.5671
127
- ```
128
-
129
- ## Hyper-Operations (Tetration & Beyond)
130
-
131
- ```javascript
132
- // Tetration: a^^b
133
- new MetaNum(2).tetr(3); // 2^^3 = 2^2^2 = 16
134
- new MetaNum(2).tetr(4); // 2^^4 = 65536
135
- MetaNum.tetr(2, 5); // 2^^5
136
-
137
- // With payload (offset)
138
- new MetaNum(10).tetr(2, new MetaNum(5)); // 10^^2 with payload 5
139
-
140
- // Pentation: a^^^b
141
- new MetaNum(2).pent(3); // 2^^^3
142
-
143
- // General arrow notation: a↑^n b
144
- new MetaNum(2).arrow(3)(4); // 2↑↑↑4 (pentation)
145
- MetaNum.arrow(3, 4, 3); // 3↑↑↑↑3 = g_1
146
-
147
- // Chain notation
148
- new MetaNum(2).chain(4, 3); // 2→4→3
149
-
150
- // Aperiation: a↑^a a
151
- new MetaNum(2).aper(3); // 2↑↑↑2 = 4
152
- ```
153
-
154
- ## Super-logarithm & Super-root
155
-
156
- ```javascript
157
- // Super-logarithm (inverse of tetration)
158
- new MetaNum(16).slog(2); // slog_2(16) = 3
159
- new MetaNum(65536).slog(); // slog_10(65536) ≈ 2
160
-
161
- // Super-square-root
162
- new MetaNum(27).ssrt(); // ssqrt(27)
163
-
164
- // Linear super-root
165
- new MetaNum(100).linear_sroot(3); // ³ss̅r̅t̅(100)
166
-
167
- // Layer arithmetic
168
- new MetaNum(10).layeradd(3); // add 3 layers of exponentiation
169
- new MetaNum(10).layeradd10(3); // 10^^3 (explicit base 10)
170
- ```
171
-
172
- ## Diagonalization / Expansion Hierarchy
173
-
174
- These functions represent iterated diagonalizations at increasing ordinal levels from ω to ε₀:
175
-
176
- ```javascript
177
- const x = new MetaNum(10);
178
-
179
- // Level ω: diagonalize ω*y (→ a↑^a a)
180
- x.aperiote(3); // aper(3) = h10
181
-
182
- // Level ω+1: iterate aperiote
183
- x.expande(3); // expa(3) = h11
184
-
185
- // Level ω+2: iterate expande
186
- x.multiexpande(3); // muea(3) = h12
187
-
188
- // Level ω+3: iterate multiexpande
189
- x.powerexpande(3); // poea(3) = h13
190
-
191
- // Level ω*2: diagonalize ω+y
192
- x.aperioexpande(3); // apea(3) = h20
193
-
194
- // Level ω*2+1: iterate aperioexpande
195
- x.explode(3); // expl(3) = h21
196
-
197
- // Level ω*2+2: iterate explode
198
- x.multiexplode(3); // muel(3) = h22
199
-
200
- // Level ω*3: diagonalize ω*2+y
201
- x.aperioexplode(3); // apel(3) = h30
202
-
203
- // Level ω*3+1: iterate aperioexplode
204
- x.detonate(3); // deto(3) = h31
205
-
206
- // Level ω*4: diagonalize ω*3+y
207
- x.aperiodetonate(3); // apdt(3) = h40
208
-
209
- // Level ω^2: diagonalize ω*y
210
- x.aperionate(3); // apeo(3) = h100
211
-
212
- // Level ω^2+1: iterate aperionate
213
- x.megote(3); // mego(3) = h101
214
-
215
- // Level ω^2+2: iterate megote
216
- x.multimegote(3); // mume(3) = h102
217
-
218
- // Level ω^2+ω: diagonalize ω^2+y
219
- x.aperimegote(3); // apmg(3) = h110
220
-
221
- // Level ω^2+ω+1: iterate aperimegote
222
- x.megoexpande(3); // mgea(3) = h111
223
-
224
- // Level ω^2+ω*2: diagonalize ω^2+ω+y
225
- x.aperimegoexpande(3); // apme(3) = h120
226
-
227
- // Level ω^2*2: diagonalize ω^2+ω*y
228
- x.megoaperionation(3); // mgao(3) = h200
229
-
230
- // Level ω^2*2+1: iterate megoaperionation
231
- x.gigote(3); // gigo(3) = h201
232
-
233
- // Level ω^2*2+ω: diagonalize ω^2*2+y
234
- x.aperigigote(3); // apgg(3) = h210
235
-
236
- // Level ω^2*3: diagonalize ω^2*2+ω*y
237
- x.gigoaperionate(3); // ggap(3) = h300
238
-
239
- // Level ω^3: diagonalize ω^2*y
240
- x.aperiatotion(3); // apat(3) = h1000
241
-
242
- // Level ω^3+1: iterate aperiatotion
243
- x.powiainate(3); // pwan(3) = h1001
244
-
245
- // Level ω^3+ω: diagonalize ω^3+y
246
- x.expandainate(3); // epan(3) = h1010
247
-
248
- // Level ω^3+ω^2: diagonalize ω^3+ω*y
249
- x.megodainate(3); // mgan(3) = h1100
250
-
251
- // Level ω^3*2: diagonalize ω^3+ω^2*y
252
- x.powiairate(3); // pwar(3) = h2000
253
-
254
- // Level ω^4: diagonalize ω^3*y
255
- x.aperioguate(3); // apgu(3) = h10000
256
-
257
- // Level ω^ω: diagonalize ω^x (layer 1 transition)
258
- x.iter(3); // ite(3) = hww
259
-
260
- // Level ω^ω+1: iterate ω^ω level operations
261
- x.itermult(3); // itmu(3) = hw01
262
-
263
- // Level ω^ω*2: (ω^ω)*2 = ω^ω + ω^base
264
- x.cuboiter(3); // cube(3) = hwx2
265
-
266
- // Level ω^(ω+1): ω^(ω+1) = ω^ω*ω → ω^(ω*y)
267
- x.expoiter(3); // expo(3) = hwa1
268
-
269
- // Level ω^(ω*2): ω^(ω*2) = ω^(ω+base)
270
- x.trioterate(3); // tria(3) = hwm2
271
-
272
- // Level ω^(ω^2): diagonalize ω^(ω*y) (layer 2)
273
- x.trixxate(3); // trix(3) = hwp2
274
-
275
- // Level ω^(ω^ω): diagonalize ω^(ω^y) (layer 3)
276
- x.aperixxate(3); // apix(3) = hwpw
277
-
278
- // Level ε₀ = ω↑↑ω: diagonalize ω↑↑y (layer 4)
279
- x.epsilonate(3); // epsl(3) = hepsl
280
- ```
281
-
282
- ## Inverse Operations
283
-
284
- Each expansion operation has a corresponding inverse for decrementing ordinal structure:
285
-
286
- ```javascript
287
- x.i_aper(z) // i10 = inverse of aperiote
288
- x.i_expa(z) // i11 = inverse of expande
289
- x.i_muea(z) // i12 = inverse of multiexpande
290
- x.i_poea(z) // i13 = inverse of powerexpande
291
- x.i_apea(z) // i20 = inverse of aperioexpande
292
- x.i_expl(z) // i21 = inverse of explode
293
- x.i_muel(z) // i22 = inverse of multiexplode
294
- x.i_apel(z) // i30 = inverse of aperioexplode
295
- x.i_deto(z) // i31 = inverse of detonate
296
- x.i_apdt(z) // i40 = inverse of aperiodetonate
297
- x.i_apeo(z) // i100 = inverse of aperionate
298
- x.i_mego(z) // i101 = inverse of megote
299
- x.i_mume(z) // i102 = inverse of multimegote
300
- x.i_apmg(z) // i110 = inverse of aperimegote
301
- x.i_mgea(z) // i111 = inverse of megoexpande
302
- x.i_apme(z) // i120 = inverse of aperimegoexpande
303
- x.i_mgao(z) // i200 = inverse of megoaperionation
304
- x.i_gigo(z) // i201 = inverse of gigote
305
- x.i_apgg(z) // i210 = inverse of aperigigote
306
- x.i_ggap(z) // i300 = inverse of gigoaperionate
307
- x.i_apat(z) // i1000 = inverse of aperiatotion
308
- x.i_pwan(z) // i1001 = inverse of powiainate
309
- x.i_epan(z) // i1010 = inverse of expandainate
310
- x.i_mgan(z) // i1100 = inverse of megodainate
311
- x.i_pwar(z) // i2000 = inverse of powiairate
312
- x.i_apgu(z) // i10000 = inverse of aperioguate
313
- x.i_ite(z) // iww = inverse of iter
314
- x.i_itmu(z) // iw01 = inverse of itermult
315
- x.i_cube(z) // iwx2 = inverse of cuboiter
316
- x.i_expo(z) // iwa1 = inverse of expoiter
317
- x.i_tria(z) // iwm2 = inverse of trioterate
318
- x.i_trix(z) // iwp2 = inverse of trixxate
319
- x.i_apix(z) // iwpw = inverse of aperixxate
320
- x.i_epsl(z) // iepsl = inverse of epsilonate
321
- ```
322
-
323
- ## BEAF Operations
324
-
325
- Bowers' Exploding Array Function (BEAF) is supported via ordinal arithmetic for 4+ arguments:
326
-
327
- ```javascript
328
- // 3-entry: {a,b,c} = a↑^c b (standard up-arrow notation)
329
- MetaNum.BEAF(3, 3, 2); // 3↑↑3 = 7625597484987
330
- MetaNum.BEAF(3, 3, 3); // 3↑↑↑3 = tritri
331
-
332
- // 4-entry: {a,b,c,d} = a(ω*(d-1)+(c-1) level operation)b
333
- MetaNum.BEAF(2, 2, 1, 2); // = 4
334
- MetaNum.BEAF(3, 3, 3, 3); // 3(ω*2+2 level operation)3
335
-
336
- // 5+ entry: ordinal arithmetic
337
- // BEAF(a,b,c,d,...,n) = a(ω^(n-3)*(arg_n-1)+...+ω*(d-1)+(c-1) level operation)b
338
- MetaNum.BEAF(10, 2, 1, 1, 2); // = BEAF(10,10,10,10) (ω^2 level operation)
339
- MetaNum.BEAF(3, 3, 3, 3, 2); // 3(ω^2+ω*2+2 level operation)3
340
-
341
- // Parse BEAF string notation
342
- MetaNum.fromBeaf("{3,3,3}"); // 3↑↑↑3
343
- MetaNum.fromBeaf("{3,3,3,3}"); // 3(ω*2+2)3
344
- MetaNum.fromBeaf("{10,2,1,1,2}"); // 10(ω^2)2
345
-
346
- // Convert to BEAF string
347
- new MetaNum(7625597484987).toBeaf(); // "{7625597484987}"
348
- MetaNum.BEAF(3,3,3).toBeaf(); // "{3638334640023.7783}"
349
- ```
350
-
351
- ## Layer & Serialization
352
-
353
- ```javascript
354
- // Layer manipulation
355
- new MetaNum(10).layerUp(); // promote to layer+1
356
- new MetaNum(10).layerDown(); // demote to layer-1
357
-
358
- // Output formats
359
- new MetaNum(123).toString(); // "123"
360
- new MetaNum(1e308).toString(); // "E308"
361
- new MetaNum(100).toNumber(); // 100
362
- new MetaNum(100).valueOf(); // "100"
363
- new MetaNum(100).toFixed(2); // "100.00"
364
- new MetaNum(100).toExponential(2); // "1.00e+2"
365
- new MetaNum(100).toPrecision(3); // "100"
366
- new MetaNum(100).toHyperE(); // "100"
367
- new MetaNum(100).toStringWithDecimalPlaces(4); // "100.0000"
368
- new MetaNum(100).toJSON(); // {sign:1, array:[[100]], layer:0}
369
- ```
370
-
371
- ## Utility Functions
372
-
373
- ```javascript
374
- // Binomial coefficient
375
- new MetaNum(10).choose(3); // C(10,3) = 120
376
-
377
- // Hyper-operation
378
- MetaNum.hyper(4, 2, 3); // 2^^3 = 16 (n=4 means tetration)
379
-
380
- // Geometric series
381
- MetaNum.sumGeometricSeries(5, 1, 2); // 1+2+4+8+16 = 31
382
- MetaNum.affordGeometricSeries(100, 1, 2, 0);
383
-
384
- // Arithmetic series
385
- MetaNum.sumArithmeticSeries(5, 1, 2); // 1+3+5+7+9 = 25
386
- MetaNum.affordArithmeticSeries(100, 1, 2, 0);
387
-
388
- // Configuration
389
- MetaNum.config({ maxRows: 200, maxCols: 200, maxArrow: 1e6, debug: 1 });
390
- ```
391
-
392
- ## Mathematical Background
393
-
394
- 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:
395
-
396
- - ω represents the first infinite ordinal
397
- - ω^ω represents ω raised to the power of ω
398
- - ε₀ is the limit of ω, ω^ω, ω^ω^ω, ...
399
-
400
- For more information, see: <https://en.wikipedia.org/wiki/Ordinal_arithmetic>
401
-
402
- The layer parameter indicates the height of the ω exponent tower, allowing representation of increasingly large ordinals.
403
-
404
- ## dlsdl's Letter Notation
405
-
406
- Modified from PsiCubed's letter notation(<https://googology.fandom.com/wiki/User_blog:PsiCubed2/My_Letter_Notation>)
407
-
408
- 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:
409
-
410
- (1) Any number has a unique standard representation in the system.
411
-
412
- (2) Given the standard representation of two numbers, one can immediately tell which one is larger without any calculations.
413
-
414
- ### The format of the proposed notation
415
-
416
- Our final notation will look like this:
417
-
418
- \[symbol]\[letter]\[number]
419
-
420
- where \[symbol] can be one of the following: empty,!,@,#,$,%,&,……
421
-
422
- where \[letter] can be one of the following: E,F,G,H,……,Aa,Ab,Ac,……,Ba,Bb,……,Aaa,……
423
-
424
- and \[number] can be any positive real number (nonintegers included).
425
-
426
- ### The First Levels: A Continuous version of Knuth Arrows
427
-
428
- We'll define:
429
-
430
- Eα=10^α
431
-
432
- Fα = EEEE...EEE(10^frac(α)) with int(α) E's
433
-
434
- Gα = FFFF...FFF(10^frac(α)) with int(α) F's
435
-
436
- Hα = GGGG...GGG(10^frac(α)) with int(α) G's
437
-
438
- then we'll have I,J,K,... to Z ,each with the same definition as Hα.
439
-
440
- Note that according to these definitions we have:
441
-
442
- (1) For α≤1: Eα = Fα = Gα = Hα = ... = Zα = 10^α
443
-
444
- (2) For any integer β: Eβ = 10↑β, Fβ = 10↑↑β, Gβ = 10↑↑↑β, Hβ = 10↑↑↑↑β
445
-
446
- the γ-th letter β represents 10(γ-4 arrows)β
447
-
448
- So the above definitions are indeed an extention of Knuth arrows to nonintegers.
449
-
450
- ### Letter-Canonical Forms
451
-
452
- 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:
453
-
454
- α = Γβ.
455
-
456
- And we call "Γβ" the Γ-Canonical Form of the number α.
457
-
458
- For example, the E-Canonical form of 1000 is E3:
459
-
460
- E3 = 10^3 = 1000.
461
-
462
- And the F-Canonical form of 1000 is about F1.47712:
463
-
464
- F1.47712 = E(10^0.47712) ≈ E3 = 10^3 = 1000.
465
-
466
- ### Binary-Letter-Canonical Forms
467
-
468
- To recreate ordinary scientific notation, we'll define a binary version of the letter functions like this:
469
-
470
- 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:
471
-
472
- αΓβ = Γ(β+log(α))
473
-
474
- For Example:
475
-
476
- 7E3 = E(3+log(7)) = 10^(3+log(7)) = 7\*10^3 = 7000
477
-
478
- 7F3 = F(3+log(7)) = EEE(10^log(7)) = EEE7 = 10^10^10^7
479
-
480
- So αEβ is nothing more than ordinary scientific notation.
481
-
482
- And αFβ is a power tower of β 10's topped by an α.
483
-
484
- 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 α.
485
-
486
- ### Defining Aa - The First Diagonalization
487
-
488
- In the previous section we've defined an infinite sequence of functions, so we can diagonalize over them:
489
-
490
- let 1|α = Eα, 2|α = Fα, 3|α = Gα, ..., 22|α = Zα.
491
-
492
- we had: Aaα = α|10.
493
-
494
- So Aa is comparable to f\_ω\_(n) in the FGH.
495
-
496
- But there are a couple of problems here:
497
-
498
- (1) α|10 isn't yet defined for noninteger α.
499
-
500
- (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:
501
-
502
- (i) α|10 = (int(α)+1)|2\*5^frac(α)
503
-
504
- (ii) For α<2: Aaα = Gα
505
-
506
- (iii) For α≥2: Aaα = α|10
507
-
508
- 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.
509
-
510
- ### Ab,Ac,Ad,...,Az and their Universal Canonical Forms
511
-
512
- The definitions of Ab,Ac,Ad,...,Az are simple enough:
513
-
514
- Abα = AaAa...AaAa(10^frac(α)) with int(α) Aa's
515
-
516
- Acα = AbAb...AbAb(10^frac(α)) with int(α) Ab's
517
-
518
- then we have Ad,Ae,...,Az, each with the same definition as Ab and Ac.
519
-
520
- And that's it. So A(the β+1-th letter) is comparable to f\_ω+β\_(n) in the FGH.
521
-
522
- 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.
523
-
524
- Moreover, since Aa10=Ab2 and Ab10=Ac2, we can extend our definition of the "Universal Canonical Form" up to Az10:
525
-
526
- (1) if α<100 (that's E2) then we write down the E-Canonical Form of α.
527
-
528
- (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.
529
-
530
- ### Defining from Ba to Bz
531
-
532
- 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:
533
-
534
- (1,0)|α = Aaα
535
-
536
- (1,β+1)|α = (1,β)|(1,β)|...|(1,β)|10^frac(α) with int(α) (1,β)'s
537
-
538
- And define Baα in a way similar to Aaα:
539
-
540
- (i) (1,α)|10 = (1,int(α)+1)|2\*5^frac(α)
541
-
542
- (ii) For α<2: Baα = (1,3)|α
543
-
544
- (iii) For α≥2: Baα = (1,α)|10
545
-
546
- 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.
547
-
548
- 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.
549
-
550
- ### A Supporting Array Notation and Aaa
551
-
552
- 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):
553
-
554
- (i) (0,1)|α = 10^α
555
-
556
- (ii) (β,γ+1)|α = (β,γ)|(β,γ)|...|(β,γ)|10^frac(α) with int(α) (β,γ)'s
557
-
558
- (iii) (β,α)|10 = (β,int(α)+1)|2\*5^frac(α)
559
-
560
- (iv) For α<2: (β+1,0)|α = (β,3)|α
561
-
562
- (v) For α≥2: (β+1,0)|α = (β,α)|10
563
-
564
- 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)|α.
565
-
566
- So QqQe308 is about f\_ω17+16\_(f\_ω17+4\_(308)).
567
-
568
- And with this new supporting notation we can now to define Aaaα:
569
-
570
- (i) For α<2: Aaaα = (2,1)|α
571
-
572
- (ii) For α≥2: Aaaα = (int(α),10\*frac(α))|10
573
-
574
- 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
575
-
576
- 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.
577
-
578
- ### Arrays with more than two variable, and !Aa
579
-
580
- Array notations can be easily extended to a multivariable array notation, like so:
581
-
582
- (i) For α≤1: (anything)|α = 10^α
583
-
584
- (ii) (β,γ,δ,...,ν+1)|α = (β,γ,δ,...,ν)|(β,γ,δ,...,ν)|...|(β,γ,δ,...,ν)|10^frac(α) with int(α) (β,γ,δ,...,ν)'s
585
-
586
- (iii) (β,γ,δ,...,ν,α)|10 = (β,γ,δ,...,ν,int(α+1))|2\*5^frac(α)
587
-
588
- (iv) For 1<α<2: (β,γ,δ,...,μ+1,<κ zeros>)|α = (β,γ,δ,...,μ,2,<κ-1 zeros>)|10^(α-1)
589
-
590
- (v) For α≥2: (β,γ,δ,...,μ+1,<κ zeros>)|α = (β,γ,δ,...,μ,α,<κ-1 zeros>)|10
591
-
592
- (vi) (β,γ,δ,...,α,<κ zeros>)|10 = (β,γ,δ,...,int(α),frac(α)\*10,<κ-1 zeros>)|10
593
-
594
- (vii) (0,...,0,β,γ,δ,...,μ)|α = (β,γ,δ,...,μ)|α
595
-
596
- 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.
597
-
598
- 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:
599
-
600
- - (114,514,1.9198,0,0,0,0)|10 = (114,514,1,9,1,9,8)|10.
601
-
602
- Now, all that is left to do is to define !Aa, which is about f\_ω^ω\_(10) in the FGH.
603
-
604
- For α<2: !Aaα = (1,0,1)|α
605
-
606
- For α≥2: !Aaα = (10^frac(α),0,...,0)|10 with int(α) zeros.
607
-
608
- 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:
609
-
610
- 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
611
-
612
- 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.
613
-
614
- ### Higher dimensional arrays and @Aa
615
-
616
- 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.
617
-
618
- (i) Other rules are the same from linear array notation
619
-
620
- (ii) (β,γ,δ,...,μ+1\[1]0,ζ)|α = (β,γ,δ,...,μ\[1]1,0,0,ζ)|10^(x-1) for 1\<x<2
621
-
622
- (iii) (β,γ,δ,...,μ+1\[1]0,ζ)|α = (β,γ,δ,...,μ\[1]10^frac(x),0,...,0,ζ)|10 with int(x) 0's for x=>2
623
-
624
- (iv) (β,γ,δ,...,α\[1]0,ζ)|10, κ = frac(α)\*10
625
-
626
- 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
627
-
628
- (v) (...\[1]0,...,0,β,γ...)|α = (...\[1]β,γ...)|α
629
-
630
- 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.
631
-
632
- 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.
633
-
634
- 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.
635
-
636
- 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.
637
-
638
- Now, all that is left to do is to define @Aa, which is about f\_ω^ω^ω\_(10) in the FGH.
639
-
640
- For α<2: @Aaα = (1\[1,0,0]0)|α
641
-
642
- For α≥2: @Aaα = (1\[10^frac(α),0,...,0]0)|10 with int(α) zeros.
643
-
644
- ### Nested arrays and more symbols
645
-
646
- The Definiton of more symbols is similar to the definition of @Aa.
647
-
648
- \#Aa \~ f\_ω^ω^ω^ω\_(10)
649
-
650
- $Aa \~ f\_ω^ω^ω^ω^ω\_(10)
651
-
652
- Then we can define (the β-th symbol or symbol combination)Aa = f\_ω^ω^...^ω(β+1 ω's)\_(10)
653
-
654
- ### Definition of the final letter: ε
655
-
656
- ε represents exponent tower layers of ω, and it is comparable to f\_ε0\_(10) in the FGH.
657
-
658
- αεβ \~ f\_ω^ω^...^ω(β ω's)\_(α)
659
-
660
- #### Using dlsdl's letter notation, the biggest number we can define in Metanum is about ε1.797e308.
661
-
662
- ## Changelog
663
-
664
- - 2026-7-9 v1.2 Add more hyper operations up to ε₀, add BEAF operation and fix bugs
665
- - 2026-6-3 v1.1 Add support for very small numbers ,add more hyper operations and fix bugs
666
- - 2026-5-23 v1.0 Rewritten and add even more hyper operations
667
- - 2026-2-24 v0.4 Add hyper operations and extend fromString
668
- - 2026-2-11 v0.3 Reconstruct code and correct calculating functions
669
- - 2026-2-6 v0.2 New Metanum data structure with Cantor normal form
670
- - 2026-2-1 v0.1 First commit
671
-
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
+