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.

Details

  • 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.

Examples

open allclose all

Basic Examples  (2)

In[1]:=
Click for copyable input
Out[1]=
In[1]:=
Click for copyable input
Out[1]=

Scope  (2)

Properties & Relations  (5)

Possible Issues  (1)

See Also

SequenceFoldList  Fold  FoldList  Partition  Nest  NestList

Introduced in 2015
(10.2)