Let Z denote the set of all integers and Z>0 denote the set of all positive integers.
(a) A function f:Z→Z is called Z-good if it satisfies f(a2+b)=f(b2+a) for all a,b∈Z. Determine the largest possible number of distinct values that can occur among f(1),f(2),…,f(2023), where f is a Z-good function.
(b) A function f:Z>0→Z>0 is called Z>0-good if it satisfies f(a2+b)=f(b2+a) for all a,b∈Z>0. Determine the largest possible number of distinct values that can occur among f(1),f(2),…,f(2023), where f is a Z>0-good function.