title: Recursive function that returns the smallest divisor
body: <p>I wrote a function that computes recursively the smallest divisor of an integer n>1:</p>
  
  <pre><code>using System;                   
  public class Program
  {
      public static void Main()
      {
          int n = Convert.ToInt32(Console.ReadLine());
          Console.WriteLine(SmallestDivisor(n));
      }
  
      public static int SmallestDivisor(int n)
      {
          return SmallestDivisor(n, 2);
      }
  
      public static int SmallestDivisor(int n, int d)
      {
          if (n%d == 0)
              return d;
          else  
              return SmallestDivisor(n, d+1);
      }
  }
  </code></pre>
  
  <p>My goal is to build a recursive function that takes only the integer n as an argument. Is there any possible alternative to avoid calling another auxiliary function taking as arguments integer n and d?</p>