title: How do I run this python program which has to check 2 x 10^25 combinations?
body: <p>I have written a program that generates all possible list of first 32 natural numbers and checks if the sum of the adjacent numbers is a perfect square.</p>
  <p>The programs has to iterate over 2.3e25 lists(pretty lot of zeroes). whenever I run the program the python kernel crashes. How do I run this program</p>
  <p>My code is</p>
  <pre><code>from itertools import permutations
  import math 
  def check(nums):
      
      for i in range(len(nums) - 1):
        y = nums[i] + nums[i + 1]
        z = y ** 0.5
        #till here found the square root of the sum of the adjacent numbers in list
        if z.is_integer() ==False:
          
        # if there is some two numbers that don't meet condition, function will return False
          return False
        return nums
  
  x = list(permutations(range(1, 33)))
  
  for q in range(len(x)):
      if (check(x[q])):
          print(x[q])
          break
  </code></pre>
  <p>The answer set I am looking for is
  [1,8,28,21,4,32,17,19,30,6,3,13,12,24,25,11,5,31,18,7,29,20,16,9,27,22,14,2,23,26,10,15].</p>
  <p>Kindly help me out</p>
  <p>PS Thanks to members who helped me in writing the function earlier
  <a href="https://stackoverflow.com/questions/67768652/how-do-i-check-the-list-elements-satisfy-a-given-condition/67772733#67772733">My earlier question</a></p>