Is there a formula to find out how many times a string of N consecutive numbers occurs in a larger string of N+ numbers. So for example how many ways can a string of n2 numbers occur in a string of n3 numbers. So if i was searching for a string of any 2 numbers in a list of 1000 numbers how many possible strings could I find - i think the answer here is 200.
However what i want is a general formula to find the number of potential strings of n numbers (eg any 4 consecutive numbers) in a much larger string of say 9 numbers (eg 1000,000,000). So for 9 zero filled digits, '1234' can occur more than once, for example in the number 123,412,341 but this would count as 1 result.
So for example there are 10,000 ways you can have a string of 4 digits. How many times can those 10,000 strings be found in a string of 9 digits where only 1 occurrence of the string needs to be found to include that number, so 123,412,341 counts as 1 result.
can anyone help with this question please? Thanks in advance.
