a) Let A={1,2,…,n} and n=k2 for some positive integer k. Denote B as the set of first m odd positive integers. It's clear that B is nice. Assume that n≥2m−1, let C=A∖B. C is nice if and only if
n−m(1+2+⋯+n)−m2=n−m⟺n=n2−4mn+4m2⟺m=2n−k.
Therefore, we can choose m so that C is nice. Hence, n is amazing.
b) We prove that if n=4k+2 for some positive integer k, then n is not amazing. Assume that A={1,2,…,n} can be partitioned into nice subsets A1,A2,…,Am with cardinality a1,a2,…,am respectively. Therefore,
2n(n+1)=x∈A∑x=i=1∑mx∈Ai∑x=i=1∑mai2=i=1∑mai=n(mod2),
that yields contradiction. □