What is the remainder of the following division:
$\frac{(x-1)^y + (x+1)^y}{x^2}$
For what values of $y$ will the remainder be maximized?
(Before anyone asks, NO this is not project euler)
What is the remainder of the following division:
$\frac{(x-1)^y + (x+1)^y}{x^2}$
For what values of $y$ will the remainder be maximized?
(Before anyone asks, NO this is not project euler)
Assuming $y,x$ a natural number and $x ≠ 0$.
If $y$ is odd, $(x-1)^y+(x+1)^y=2(x^y+^yC_2x^{y-2}+...+^yC_{y-1}x)≡2xy\pmod{x^2}$
Now, $0≤2xy\pmod{x^2}
If $x$ is odd, the maximum remainder of $2y\pmod{x}$ is $(x-1)$, which will make the remainder maximum $= (x-1)x$.
So, $2y=kx+(x-1)$ will lead to the same maximum remainder, where $k$ any non-negative integer.
If $x$ is even, the maximum remainder of $2y\pmod{x}$ is $(x-2)$ which will make the remainder maximum $=(x-2)x$.
So, $2y=kx+(x-2)$ will lead to the same maximum remainder, where $k$ any non-negative integer .
If $y$ is even, $(x-1)^y+(x+1)^y=2(x^y+^yC_2x^{y-2}+...+^yC_{y-2}x^2+1)≡2\pmod{x^2}$, so the remainder is constant for all even $y$ .