SequenceFold

SequenceFold[f,{x1,,xn},{a1,a2,}]
gives the last element of SequenceFoldList[f,{x1,,xn},{a1,a2,}].

SequenceFold[f,{x1,,xn},{a1,a2,},k]
applies f to k arguments at each step, with the first n coming from the xi or previous results, and the last k-n coming from the ai.

DetailsDetails

  • In SequenceFold[f,{x1,,xn},{a1,a2,}], the function f is assumed to have n+1 arguments.
  • SequenceFold[f,{x},{a1,a2,}] is equivalent to Fold[f,x,{a1,a2,}].
  • SequenceFold[f,{x1,,xn},{a1,a2,}] is equivalent to SequenceFold[f,{x1,,xn},{a1,a2,},n+1].
  • In SequenceFold[f,{x1,,xn},{a1,a2,},k], the integer k must obey kn.
Introduced in 2015
(10.2)