Some of the best public elementary schools in New York City are in Community School District 3, on Manhattan’s West Side. At those schools, the vast majority of children pass the annual state tests, gifted and talented programs buzz with activity, and special programs attract promising young musicians or families who want a progressive approach to education.

But none of those schools are in Harlem.

In District 3’s Harlem schools, there are no gifted and talented programs. Of the six elementary schools there where students take the state tests, only one comes close to the citywide passing rates of 38 percent in reading and 36 percent in math. At one school, only 6 percent of third- through eighth-grade students passed the most recent math tests.

The children in the Harlem schools are mostly black and Hispanic and low-income, while the majority of children in the district’s other elementary schools are white or Asian, and either middle class or wealthy.

The New York Times has been examining the district over the past few months to look at the forces that shape the racial and economic makeup of the city’s schools. Unlike in many parts of the city, in District 3 — which runs from 59th Street to 122nd Street along Manhattan’s western flank, then takes a dogleg into Harlem — people from different races and socioeconomic levels often live near one another. The district’s schools, however, are sharply divided by race and income, and diverge just as sharply in their levels of academic achievement.