N-scaling algorithm for density-functional calculations of metals and insulators | Synapse