title: How to find row number of a chosen number in a triangular number sequence?
body: <p>I'm trying to find the row number in a chosen square in this:</p>
  
  <p><a href="https://i.stack.imgur.com/Y8Cf3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y8Cf3.png" alt="enter image description here"></a></p>
  
  <p>For instance if I choose <code>getRow(17)</code> I would get <code>answer = 6</code>. I don't even know where to begin. Can someone point me in the right direction?</p>
  
  <pre><code>class RowShelf{
     public static void main(String[] args) {
        getRow(24); // ans = 7
        getRow(17); // ans = 6
     }
  
     public static int getRow(int sq){
  
    }
  }
  </code></pre>