Mystery list comprehension

Question Q4.3.2

What does the following code do and how does it work?

>>> nmax = 5
>>> x = [1]
>>> for n in range(1,nmax+2):
...     print(x)
...     x = [([0]+x)[i] + (x+[0])[i] for i in range(n+1)]
...

Solution Q4.3.2