The coil-globule transition has been studied for A-B copolymer chains both by means of lattice Monte Carlo (MC) simulations using bond fluctuation algorithm and by a numerical self-consistent-field (SCF) method. Copolymer chains of fixed length with A and B monomeric units with regular, random, and specially designed (proteinlike) primary sequences have been investigated. The dependence of the transition temperature on the AB sequence has been analyzed. A proteinlike copolymer is more stable than a copolymer with statistically random sequence. The transition is more sharp for random copolymers. It is found that there exists a temperature below which the chain appears to be in the lowest energy state (ground state). Both for random and prote...