Step 1: Translate the problem into equations.
Let \(PQ\) mean the two-digit number \(10P+Q\), and \(RS\) mean \(10R+S\). We are told \(PQ\) and \(RS\) are consecutive integers. We are also told \((PQ)^2+(RS)^2\) is a three-digit number \(XYP\), meaning it equals \(100X+10Y+P\), so its units digit must equal \(P\), the tens digit of \(PQ\). All six letters \(P,Q,R,S,X,Y\) stand for six different digits.
Step 2: Find the range of possible values.
Let \(n=PQ\), and take \(RS=n+1\) (we check the reverse pairing later). We need \(n^2+(n+1)^2\) to stay a 3-digit number while both \(n\) and \(n+1\) are 2-digit numbers.
\[ n^2+(n+1)^2 = 2n^2+2n+1 \]
At \(n=10\): \(2(100)+20+1=221\). At \(n=21\): \(2(441)+42+1=925\). At \(n=22\): \(2(484)+44+1=1013\), already 4 digits. So only \(n=10\) through \(n=21\) can possibly work.
Step 3: Rule out most of these using the distinct-digit rule.
For every \(n\) from 10 to 18, both \(n\) and \(n+1\) sit in the 10s, so \(P=\) tens digit of \(n=1\) and \(R=\) tens digit of \(n+1=1\) as well, forcing \(P=R\), which breaks the rule that all six letters are different. So every \(n\) from 10 to 18 is rejected. Checking \(n=20\) (pair 20, 21) and \(n=21\) (pair 21, 22) the same way, both tens digits are 2 in each pair, again forcing \(P=R\). Only \(n=19\), where \(n+1=20\) crosses into a new decade, lets the tens digits of \(PQ\) and \(RS\) actually differ.
Step 4: Test \(n=19\).
\(PQ=19\) gives \(P=1\), \(Q=9\). \(RS=20\) gives \(R=2\), \(S=0\).
\[ 19^2+20^2 = 361+400=761 \]
The units digit of 761 is 1, which must equal \(P\). Here \(P=1\), so it matches exactly. That gives \(X=7\) and \(Y=6\).
Step 5: Confirm all six digits are distinct, and check the reverse pairing.
\(P=1,\ Q=9,\ R=2,\ S=0,\ X=7,\ Y=6\): all six values \(\{1,9,2,0,7,6\}\) are different digits, so this fully satisfies the question. Checking the reverse pairing, \(PQ=20,\ RS=19\), gives \(P=2\), but the sum's units digit is still 1, so \(1 \ne 2\) and this reverse assignment fails. So \(PQ=19,\ RS=20\) is the only working case.
Final Answer:
The value of \(Y\) is 6.
\[ \boxed{Y=6} \]