Consider a sequence starting with . The rule for finding the next term is: if the current term is a perfect square, the next term is . If the current term is not a perfect square, the next term is . This sequence eventually enters a repeating loop. What is the sum of the unique numbers inside that loop?