title: More efficient way to bruteforce finding solutions to (x+y)^2=str(x)+str(y)? Can it be vectorised?
body: <p>So far I have written:</p>
  
  <pre><code>n=1000
  solutions=[]
  for i in range(1,n+1):
      for j in range(1,n+1):
          if str((i+j)**2)==str(i)+str(j):
              solutions.append("("+str(i)+"+"+str(j)+")^2 = "+str((i+j)**2))
  for solution in solutions:
      print(solution)
  </code></pre>
  
  <p>This takes 1.03 seconds on my computer. Is there a quicker way to implement the comparison? I found a page on <a href="https://realpython.com/numpy-array-programming/#what-is-vectorization" rel="nofollow noreferrer">vectorisation</a> but I'm not sure how I would generate the list I would need to then vectorise the comparison.</p>