```python
from itertools import repeat
from sympy import *
```


```python
init_printing()
```


```python
z, x, t, n = symbols('z x t n', positive=True)
o = symbols('o0:50', commutative=False)
u = symbols('u0:50', commutative=True)
```


```python
lst = 1/(1-z)
```


```python
catalan = (1-sqrt(1-4*z))/(2*z)
catalan
```


```python
catalan.series(z, n=10)
```


```python
catalan.diff(z,3).ratsimp().series(z, n=10)
```


```python
integrate(lst, (z,0,z))
```


```python
integrate(catalan, (z,0,z)).series(z,n=10)
```


```python
lst = (1/(1-z))
lst
```


```python
lst.diff(z,4).series(z,n=10)
```


```python
5040/24
```


```python
((1/(1-t))*(1/(1-t**5))*(1/(1-t**10))).apart()
```

---


```python
def multiples(z, digits=set(range(10)),degree=3):
    return sum(o[i]*z**i for i in digits)**degree
```


```python
multiples(z) 
```


```python
multiples(z).series(z,n=10)
```


```python
number = 3
eps = exp(2*pi*I/number)
eps
```


```python
assert 0 == sum(eps**i for i in range(number)).simplify()
```


```python
s = sum(multiples(z*eps**i) for i in range(number)).expand().collect(z)
```


```python
D = dict(zip(o, repeat(S.One)))
muls = sum((c/number).simplify()*z**i 
           for i in range(40) 
           for c in [s.coeff(z,i)]
           for d in [c.subs(D, simultaneous=True).radsimp()]
           if d.is_Integer)
```


```python
muls
```


```python
muls.subs(dict(zip(o, u)))
```


```python
muls.subs(dict(zip(o, repeat(1))))
```


```python
s = _.coeff(z,8)
s.radsimp()
```


```python
_.simplify()
```


```python
_.powsimp()
```


```python

```

dccef367d3dec565e972f4a57e042aac504ca914
ipynb
Jupyter Notebook
notes/set-based-type-system/Untitled.ipynb
massimo-nocentini/simulation-methods
f7578a9719b1a22e5a25a8de85cc229aef4c259d
MIT
notes/set-based-type-system/Untitled.ipynb
massimo-nocentini/simulation-methods
f7578a9719b1a22e5a25a8de85cc229aef4c259d
MIT
notes/set-based-type-system/Untitled.ipynb
massimo-nocentini/simulation-methods
f7578a9719b1a22e5a25a8de85cc229aef4c259d
MIT
Qwen/Qwen-72B
1. YES
2. YES