Mathematical way to find a sequence of digits in an integer, programing crossover question - MathOverflow [closed] most recent 30 from http://mathoverflow.net 2013-05-25T22:37:09Z http://mathoverflow.net/feeds/question/11494 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/11494/mathematical-way-to-find-a-sequence-of-digits-in-an-integer-programing-crossover Mathematical way to find a sequence of digits in an integer, programing crossover question Vincent 2010-01-12T02:34:37Z 2010-01-12T02:54:18Z <p>I am trying to find a way to mathematically discover if an integer(of know length) has a specific sequence of digits in a known location, that is I know to look at digits 4-8. For example lets say I have numbers of length 20 and I would like to know it if digits 4,5,6,7 are all 4's. For 35344442345321456754 it is true.</p> <p>I am attempting to write a program to do this in python. I is possible for me to convert the integer to a string and look for the patter in the string. I don't want to do this. I would like a purely mathematical solution.</p> <p>I can't help but think there is an obvious way to do this so I am hoping this will be an easy answer for someone.</p> <p>I hope this question is appropriate at mathoverflow, I am kinda new to the site and the quality of questions and answers are impressive.</p>