<s>[INST] If $ax+by = a^n + b^n$ then $\left[\frac{x}{b}\right]+\left[\frac{y}{a}\right]=\left[\frac{a^{n-1}}{b}\right]+\left[\frac{b^{n-1}}{a}\right]$ 
Let a,b,n be positive integers such that $(a,b) = 1$.
Prove that if $(x,y)$ is a solution of the equation $ax+by = a^n + b^n$ then
$$\left[\frac{x}{b}\right]+\left[\frac{y}{a}\right]=\left[\frac{a^{n-1}}{b}\right]+\left[\frac{b^{n-1}}{a}\right]$$

So I was trying this question which is a Romania TST problem.
$$ax+by=a^n+b^n\implies a^n-ax=b^n-by\implies \frac{a^n-ax}{ab}=\frac{b^n-by}{ba}$$
$$\frac{a^{n-1}-x}{b}=\frac{b^{n-1}-y}{a}\implies \frac{a^{n-1}}{b}-\frac{x}{b}=\frac{b^{n-1}}{a}-\frac{y}{a}. $$
I don't think so we can proceed more.
We also have $a(a^n-ax)=b(b^n-y)\implies a^{n-1}\equiv x\mod b, b^{n-1}\equiv y\mod a.$
Any hints on how to proceed?
 [/INST] We will prove John's final observation:

If $a, b$ are co-prime positive integers, and $ c, d, x, y$ are integers such that $ax+by = ac + bd$, then
$$\left\lfloor \frac{x}{b} \right\rfloor + \left\lfloor \frac{y}{a} \right\rfloor =  \left\lfloor \frac{c}{b} \right\rfloor + \left\lfloor \frac{d}{a} \right\rfloor. $$

As observed by Teresa, the statement is true without the floor brackets, so with the floor brackets, we know that the values are very close.
Subtracting from $ \frac{x}{b} + \frac{y}{z} = \frac{c}{b} + \frac{d}{a}$, the observation is equivalent to demonstrating:
$$\left\{ \frac{x}{b} \right\} + \left\{ \frac{y}{a} \right\} =  \left\{ \frac{c}{b} \right\} + \left\{ \frac{d}{a} \right\}. $$
Since $ a (x-c) = b (y-d)$ and $ \gcd(a, b) = 1$, so $ b \mid x - c$, and thus $\left\{ \frac{x}{b} \right\} = \left\{ \frac{c}{b} \right\}. $ In fact, it is equal to $\frac{ x \pmod{b} } { b}$.
Likewise, $ a \mid y-d$, and thus $\left\{ \frac{y}{a} \right\} = \left\{ \frac{d}{a} \right\}$.
Adding up these equalities, we get the desired result.
</s>