title: Need Improve Sequence Detection Algorithm
body: <p>This question is complex, so please ask questions for explaining more detail on this quesiton. (ps. Im not native English speaker, thats why...)</p>
  
  <p>the input is that <strong><em>sample</em> sequence</strong> with length of 34, while the output is the <strong>result</strong> part</p>
  
  <p>For now, I have a sequence <strong><em>sample</em></strong> that is <strong>length of 34</strong>, it may be constructed as:
  ("result" is what I need)</p>
  
  <p>The <strong><em>sample</em> sequence</strong> = <strong>result</strong> part + <strong>known sequence</strong> (I didnt know the length of <strong>result</strong> part)</p>
  
  <ol>
  <li><strong>result</strong> (length 34)</li>
  <li><strong>result</strong> (length N, N &lt; 34) + <strong>known sequence</strong> (34 - N)</li>
  </ol>
  
  <p>All those numbers in sequence are random.</p>
  
  <p>Right now, I need to find <strong>result</strong> part without including the <strong>sequence known</strong> part.</p>
  
  <p>Some background info:</p>
  
  <ol>
  <li><p>I have 10 millions this <strong><em>sample</em> sequence</strong> with length of 34.
  (10 millions of knowing 34 digits random number sequence from generator)</p></li>
  <li><p>After I find the result, I will need to make it to compare on a 5 million length of sequence <em>B</em>, and find if the result sequence is uniquely match on the long sequence somewhere.</p></li>
  </ol>
  
  <p>My current algrothm is to use a <strong>detector</strong> which is first 10 digits of <strong>known sequence</strong>, and remove the sequence after if I detect detecter sequence somewhere in <strong><em>sample</em> sequence</strong>. However, there is still a chance that <strong>result</strong> contains the part of sequence inside of the <strong>known sequence</strong>. Does anyone has a better algrothm?</p>
  
  <p>Thanks so much! In addition, I'm programming this under python.</p>
  
  <p>ex. </p>
  
  <p><strong>1st condition</strong>:</p>
  
  <p>199010104761700150004736290473629657 == sample seq</p>
  
  <p>all are result and known part still the same</p>
  
  <p>input:</p>
  
  <p>199010104761700150004736290473629657</p>
  
  <p>output:</p>
  
  <p>199010104761700150004736290473629657</p>
  
  <p><strong>2nd condition</strong>:</p>
  
  <p>199010104728392817111123995561547659 == sample seq</p>
  
  <p>1990101047 == result part</p>
  
  <p>28392817111123995561547659... == known part</p>
  
  <p>input will be: 199010104728392817111123995561547659, 28392817111123995561547659...</p>
  
  <p>output I want is: 1990101047</p>