title: Determine if a number is divisible by 3 without using mathematical operators
body: <p>I got this assignment as homework and I can't figure out how to do it:</p>
  
  <blockquote>
    <p>Input is a string of the numbers 1, 2 and 3.<br>
    You need to build a function that determines if the number represented by the string is divisible by 3.</p>
    
    <p><strong>Rules:</strong></p>
    
    <ul>
    <li>No loops.</li>
    <li>No math operations (+,-,*,/,%) on the number.</li>
    <li>Use recursion.</li>
    </ul>
    
    <p><strong>Hint:</strong> if the sum of the digits of a number is divisible by 3 - so is the number.</p>
  </blockquote>
  
  <p>I tried using the hint to come up with an algorithm to do this, but it does not work (if 1 and 2 appear an equal number of times, then the number is divisible by 3. But then if the number is composed of only 1 or 2 it can still be divisible, and we found ourselves again with the same problem).</p>
  
  <p>Any ideas?</p>