0
votes
1answer
61 views

Creating If statements programmatically [duplicate]

I want to write an algorithm that returns a sequence of numbers, starting from a specified point but stopping once a criterion has been reached. For example ...
2
votes
0answers
91 views

Faster Ways to compute recursive summation

It takes a long time to compute the summation below, and I'd like to know if there are some better ways to compute things faster. I have used $3$ ways to calculate, but they are very unsatisfactory. I ...
2
votes
1answer
119 views

Match a sequence of integers

I would to match a pattern p1 = 0,0,1,0,0 to the elements in listA. The elements are a boolean sequence that may look like this ...