Fold over a list keeping an n-element history at each step and returning all results
SequenceFoldList[f, {x1, …, xn}, {a1, a2, …}]
SequenceFoldList[f, {x1, …, xn}, {a1, a2, …}, k]
SequenceFoldList[f, {x, y}, {a, b, c}]
→ {x, y, f[x, y, a], f[y, f[x, y, a], b], f[f[x, y, a], f[y, f[x, y, a], b], c]}SequenceFoldList[f, {x, y}, {a, b, c}, 4]
→ {x, y, f[x, y, a, b], f[y, f[x, y, a, b], b, c]}SequenceFoldList[f, {x, y}, {a, b, c, d}]
→ {x, y, f[x, y, a], f[y, f[x, y, a], b], f[f[x, y, a], f[y, f[x, y, a], b], c], f[f[y, f[x, y, a], b], f[f[x, y, a], f[y, f[x, y, a], b], c], d]}