Stateful channel iteration and Fibonacci numbers (source code)

= Stateful channel iteration and Fibonacci numbers
{title2=$(x,p)\mapsto(x+p,x)$}

Consider a component that remembers its previous input $p$ and maps input $x$ to $x+p$, then sets $p:=x$. Feeding each output back into the same component gives state transition $(x,p)\mapsto(x+p,x)$. Starting at $(1,0)$, the successive outputs are $1,2,3,5,\ldots$, the <Fibonacci numbers> $F_{k+1}$ after $k\geq1$ calls. The state transition, rather than a memoryless <function> on one <integer>, explains the recurrence. Replacing the component between calls or repeatedly feeding a fixed external input gives different behavior.