[quote=“cskandakumar143, post:1, topic:9727”]

sequence of data which are not consecutive and shifting them do not yield the required results then how to address them?

for example, I have dataset like91,97,99…591,597,599

[/quote]

As I understand, if there is no helpful pattern, and there is no additional information which can help us apply some prior knowledge to count, it will need to be counted manually.

By counting, we basically are counting the number of outcomes.

If the outcomes are simple cases like 3, 6, 9…30, we can use maths tricks to *count* the number of outcomes. For e.g. divide by 3 so that we have 1, 2, …10. And we can see total outcomes are 10.

(In your example, it seems numbers follow a pattern, so some math trick can be applied to count quickly)

In other more complex scenario, for e.g. to draw 2 cards from a deck of 52 cards, we can use our knowledge of Combination i.e C(n, 2).

But, there might not always be a math formula or trick to count the number of outcomes quickly, and manual counting might be the way to go.