# [Python 2], 140 bytes <!-- language-all: lang-python --> n=input() x=[[0,]*n+[1]+n*[0,]] z=n%2 exec'x+=[[(i%2^z)*sum(x[-1][i-1:i+2])for i in range(2*n+1)]];z^=1;'*(n-1) print map(sum,zip(*x))[1:-1] [Try it online!] or [Try all test cases](https://tio.run/nexus/python2#PcxBCoMwEEDRvaeYjTgTE@ikdBPxJCEFaWOZhVOxCsHLW7vp8sPnHc88wohKoYLSx3ixyWgbObVqfpEq2HutfQW55EdT2vNBqf19J/PZJizRcYriOEjrE43vBQREYRn0ldGfFlNK3X7vuWsMqmOqYF5EV1DbgIPGTsOMJ2V3mdEUosjhNI8/JTpvK1IYUeiIbL292ptlTl8 "Python 2 – TIO Nexus") [Python 2]: https://docs.python.org/2/ [Try it online!]: https://tio.run/nexus/python2#FcxBCoMwEEDRfU6RjTiTKHSyVHKSMIIUW2bhNFiFkMvbdPnh826Novk6AU2JKT0GduoTsVf3DzY1ahfMVrZnX3w7QLqwVHTfa4eSRuIkI03iA@Prc1ixovZY9b1BaBIh81yXSHPvQEdCkw/R0@5rhiYMVTK4gphoatR9E/0A "Python 2 – TIO Nexus" <sup>For `n=3`</sup> Starts with a list with `n` zeros surround an one - `[[0, 0, 0, 1, 0, 0, 0]]` Generate the full pyramid [[0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 1, 0, 0], [0, 1, 0, 2, 0, 1, 0]] Rotate 90º and sum each row, discarding the first and the last one (only zeros) [[0, 0, 0], [0, 0, 1], [0, 1, 0], [1, 0, 2], [0, 1, 0], [0, 0, 1], [0, 0, 0]]