Leonardo numbers: Difference between revisions

m
→‎{{header|jq}}: tweak spaces
m (→‎{{header|jq}}: newline)
m (→‎{{header|jq}}: tweak spaces)
Line 251:
| .[n] = .[n-1] + .[n-2] + incr
end;
. as $n | [zero,one] | leo($n) | .[$n];</lang>
 
(To compute the sequence of Leonardo numbers L(1) ... L(n) without redundant computation, the last element of the pipeline in the last line of the function above should be dropped.)
2,459

edits