Number theory: an approach through history; from Hammurapi to Legendre