Let p>3 be a given prime number. For a set S⊆Z and a∈N , define
Sa={x∈{0,1,2,...,p−1} | (∃s∈S)x≡pa⋅s} .
(a) How many sets S⊆{1,2,...,p−1} are there for which the sequence
S1,S2,...,Sp−1 contains exactly two distinct terms?
(b) Determine all numbers k∈N for which there is a set S⊆{1,2,...,p−1} such
that the sequence S1,S2,...,Sp−1 contains exactly k distinct terms.Proposed by Milan Basic and Milos Milosavljevic