title: creating a repeating math function in javascript?
body: <p>This may seem like a stupid question but I just started learning javascript about a week ago. I decided to try and automate my homework with javascript but I can't figure out how to do this. It works as follows:</p>
  
  <p>You are calculating how many decades it takes for a population to reach a certain number.</p>
  
  <p>We'll make this simple and make the growth rate .20. The population will start at 50 and we want it to reach 100.</p>
  
  <p>So far this is what I have:</p>
  
  <pre><code>    function newPeople(start, growth) {
      var a = start * growth;
      var b = start + a;
      var c = Math.round(b);
      var d = c * growth;
      var e = c + d;
      var f = Math.round(e);
      return f;
      }
  
      newPeople(50, .20);
  </code></pre>
  
  <p>You can see that it can be done manually by creating a new set of variables each time, but how do I automate that?</p>