You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: requirements/OEIS.md
+87-2Lines changed: 87 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,18 @@
3
3
[!] Need to think more about MathJSON API. What does "ClosedForm" return? Is it
4
4
a function? Or is there such a think as a "Series" type?
5
5
6
+
**✅ UPDATE (2026)**: The LaTeX parser now has a `strict: false` option that accepts Math-ASCII/Typst-like syntax (e.g., `sin(x)`, `x^(n+1)`, `a_(k+m)`). This **may eliminate the need for a separate ASCII Math parser** for OEIS formulas. See [LaTeX Parser Non-Strict Mode](#latex-parser-non-strict-mode) section for details.
7
+
6
8
## Summary
7
9
8
10
Add the ability to parse OEIS formula notation and reconstruct usable sequence
9
-
definitions. This is achieved by creating an **ASCII Math parser** (inverse of
11
+
definitions. This can be achieved through two approaches:
12
+
13
+
**Option A (Original Plan)**: Create an **ASCII Math parser** (inverse of
10
14
the existing `toAsciiMath()` serializer), with OEIS support as a thin wrapper.
11
15
16
+
**Option B (Simplified)**: Leverage the LaTeX parser's `strict: false` mode which already handles most ASCII Math/OEIS notation, reducing implementation complexity.
17
+
12
18
## Approach
13
19
14
20
**Strategy**: Build an ASCII Math parser, use it for OEIS formulas
@@ -44,10 +50,49 @@ ASCII Math string. We create the inverse: ASCII Math string → BoxedExpression.
44
50
45
51
The main transformation needed for OEIS: `a(n-1)` → `a_(n-1)`
46
52
53
+
## LaTeX Parser Non-Strict Mode
54
+
55
+
**UPDATE**: The LaTeX parser now supports a `strict: false` option that accepts
56
+
Math-ASCII/Typst-like syntax, which overlaps significantly with OEIS notation:
57
+
58
+
```typescript
59
+
ce.parse('sin(x)^(n+1)', { strict: false })
60
+
// Accepts:
61
+
// - Parentheses for superscripts/subscripts: x^(n+1), a_(k+m)
62
+
// - Bare function names: sin(x), cos(x), log(x), sqrt(x), etc.
63
+
// - Division with slash: (n+1)/b
64
+
65
+
// Supported bare functions:
66
+
// Trig: sin, cos, tan, cot, sec, csc
67
+
// Hyperbolic: sinh, cosh, tanh, coth, sech, csch
68
+
// Inverse: arcsin, arccos, arctan, asin, acos, atan
0 commit comments