# Determining moving ratios over a list

To know how fast values in a list approach 1 I tried

#[[1]]/#[[2]] & /@ Partition[{5040, 1460, 280, 76, 16, 2, 1}, 2, 1]


This works, but I seek a better method, perhaps through mapping a function over the list:

f /@ {5040, 1460, 280, 76, 16, 2, 1}


What could be the form of this f?

list = {5040, 1460, 280, 76, 16, 2, 1};


### Ratios:

1 / Ratios @ list


{252/73, 73/14, 70/19, 19/4, 8, 2}

Reverse @ Ratios @ Reverse @ list


{252/73, 73/14, 70/19, 19/4, 8, 2}

### Divide:

Divide[Most @ #, Rest @ #]& @ list


{252/73, 73/14, 70/19, 19/4, 8, 2}

### MovingMap:

MovingMap[Divide @@ # &, list, 1]


{252/73, 73/14, 70/19, 19/4, 8, 2}

### BlockMap:

BlockMap[Divide @@ # &, list, 2, 1]


{252/73, 73/14, 70/19, 19/4, 8, 2}

### Partition + Divide:

Divide @@@ Partition[list, 2, 1]


{252/73, 73/14, 70/19, 19/4, 8, 2}

Partition[list, 2, 1, {1, -1}, {}, Divide]


{252/73, 73/14, 70/19, 19/4, 8, 2}

• +1 There is also Most[#]/Rest[#]&@list. Of these, Reverse@Ratios@Reverse@list is the quickest (RepeatedTiming) for this size list. Commented Jan 1, 2020 at 19:14