  Quadratic residue patterns modulo a prime are studied since 19th century. In
the first part we extend existing results on the number of consecutive
$\ell$-tuples of quadratic residues, studying corresponding algebraic curves
and their jacobians, which happen to be products of jacobians of hyperelliptic
curves. In the second part we state the last unpublished result of Lydia
Goncharova on squares such that their differences are also squares, reformulate
it in terms of algebraic geometry of a K3 surface, and prove it. The core of
this theorem is an unexpected relation between the number of points on the K3
surface and that on a CM elliptic curve.
