title: Deal with extremely large numbers with Python Programming
body: <p>When we are talking about complexity of our codes most of time we consider about the number of inputs. Usually we don't much consider about under laying hardware implementation. To get a connectivity between  complexity of code and number of input which we compose to our algorithm(Code) we use Big_O notation commonly . loop are essential thing to implement algorithm but it has O(n) complexity which means time will grow linearly with number of input so large number of inputs it inefficient. but we can replace loop by recursion cause recursion always has O(log n) time complexity .And i am not going to clarify it on here . From all of these above But i want to say recursion is more efficient than loop </p>
  
  <p>and also any thing which can do loop we can do that same thing by recursion more efficiently.</p>
  
  <p>so i found a Question from <a href="https://projecteuler.net/problem=48" rel="nofollow noreferrer">Project Euler.net</a> call <a href="https://projecteuler.net/problem=48" rel="nofollow noreferrer">self powers</a> </p>
  
  <p>follow is my Question </p>
  
  <p><strong>The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
  Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.</strong></p>
  
  <p>this Question seems easy so i implement my code from Python and its <em>work smoothly for <strong>small number</strong> of number ranges</em> but  getting power of 1000 to 1000 and sum of all above python usually show a error (cause that numbers are extremely larger which enough to occur in memory flow in python) so how do i get the answer. follow is my code </p>
  
  <pre><code>def f(n):
      if n==1:
          return 1
      else:
          return n**n+f(n-1)
  </code></pre>
  
  <p>So my Question is How do i solve this problem,and how to i deal with those extremely large number , how do i manage those exception which will occur on large number of integers please mention good motivative algorithm?</p>