title: More efficient way to write this simple Python non-sequential number generator?
body: <p>Is there a more efficient way to write this so it's not looping from 1 to n (which hangs on n == 2**32):</p>
  
  <pre><code>def ns_num(n, seed, modulo, incrementor):
      assert n &lt; modulo
  
      current = seed # some start value
      for i in xrange(1, n):
          current = (current + incrementor) % modulo
  
      return current
  
  print ns_num(5, 3250, 87178291199, 17180131327)
  print ns_num(2**32, 3250, 87178291199, 17180131327)
  </code></pre>