Disclosed herein is a method for synthesizing a desired nucleic acid
sequence. The method comprises dividing the desired sequence into a
plurality of partially overlapping segments; optimizing the melting
temperatures of the overlapping regions of each segment to disfavor
hybridization to the overlapping segments which are non-adjacent in the
desired sequence; allowing the overlapping regions of single stranded
segments which are adjacent to one another in the desired sequence to
hybridize to one another under conditions which disfavor hybridization of
non-adjacent segments; and filling in, ligating, or repairing the gaps
between the overlapping regions, thereby forming a double-stranded DNA
with the desired sequence. Also disclosed is a method for preventing
errors in the synthesis of the nucleic acid sequence.