On 2- and 3-periodic Lyness difference equations