title: Perfect square with perfect digits within a range
body: <p>What is the best way to get all the perfect squares with perfect digits between a range [a,b]? 
  A perfect digit perfect square is the one with all its digits perfect squares.
  I did as follows</p>
  
  <pre><code>for j=a to b
      do if(checkPerfectSquare(j) &amp;&amp; checkPerfectDigit(j))
          then ctr++
  print ctr
  
  int checkPerfectSquare(n)
  {
  if n&lt;0
      return 0
  root=round(sqrt(n))
  return (n==root*root)
  }
  
  int checkPerfectDigit(n)
  {
  while n&gt;0
      do rem=n%10
         n=n/10
      if(!checkPerfectSquare(rem))
          return 0
  return 1
  }
  </code></pre>