How many tokens would person A have under these conditions? Persons A and B each have a positive integer number of tokens, and the number of tokens B has is a square number less than 100. B says to A, "If you give me all of your tokens, my total number of tokens will still be a square number." A says, "Yes - if on the other hand, you give me the same number of tokens that I already have, your total number of tokens will also be a square number." How many tokens does A have?

Let's start by listing all the square numbers between $0$ and $100$ $$1,4,9,16,25,36,49,64,81$$ Note we do not include $100$. We know that $$B \in  [1,4,9,16,25,36,49,64,81]\\B+A \in [1,4,9,16,25,36,49,64,81,100,121,144,...]\\ B-A \in [1,4,9,16,25,36,49,64,81,100,121,144,...]$$ So what we need to find in a square equidistant from 2 other squares. Note that the last 2 sets aren't limited to be less than 100. We can derive some more equalities $$B= b^2, A=a, B+A=c^2, B-A=d^2\\b^2+a=c^2\\b^2-a=d^2\\b^2+b^2=c^2+d^2\\2b^2=c^2+d^2$$ This tells us that the sum of our two new squares can't be more than twice $b^2$. At this point we can almost brute force it as we only have $9$ choices for $b$. going through the list, $b$ cannot be $1,2,3,4$. When we get to $b=5$ however, we have $$2(5)^2= c^2 + d^2\\50 = c^2+d^2\\50=1^2+7^2\\50=1+49\\50=50$$So the solution to our problem is $$A=24$$
