Primary treatment of sewage and anaerobic treatment of sludge