First observe that if ai≡bi(modr), i=1,2,…,n then p(a1,a2,…,an)≡p(b1,b2,…,bn)(modr). If u and v are coprime then given b1,b2,…,bn and c1,c2,…,cn with 0≤bi<u and 0≤ci<v by the chinese remainder theorem there exist unique integers a1,a2,…,an with 0≤ai<uv such that ai≡bi(modu) and ai≡ci(modv), which imply p(a1,a2,…,an)≡p(b1,b2,…,bn)(modu), p(a1,a2,…,an)≡p(c1,c2,…,cn)(modv). Thus
gcd(p(a1,a2,…,an),uv)=1⟺{gcd(p(a1,a2,…,an),u)=1gcd(p(a1,a2,…,an),v)=1
and k(uv)=k(u)⋅k(v).
For p prime gcd(p(a1,a2,…,an),ps)=1⟺gcd(p(a1,a2,…,an),p)=1. Divide each ai by p, obtaining quotient qi and remainder ri. Reducing modulo p, we obtain gcd(p(a1,a2,…,an),p)=1⟺gcd(p(r1,r2,…,rn),p)=1. Given ri there are ps/p=ps−1 possibilities for qi such that 0≤ai<ps. Hence k(ps)=(ps−1)nk(p)=pn(s−1)k(p), as required.