- #1

- 103

- 0

**X**

^{(k+1)}-X^{(k-d)}-X^{(k-d-1)}-...-1What I have so far is

Code:

```
k = 5;
d = 3;
syms X;
i = 0;
while (k-(d+i) >= 0)
terms(i+1) = k-(d+i);
i = i+1;
end
for j=1:i
poly = X^(k+1);
poly = inline(poly - X^(terms(j)));
end
```

In this example, the desired polynomial is

**X**

^{6}-X^{2}-X-1What the code is producing is

**X**

^{6}-1Any ideas on what I can do to produce the correct polynomial?

Thanks in advance.