Numerous push-pull polyenes and carotenoids of increasing length and bearing various donor and acceptor end groups have been synthesized in order to investigate the chain-length dependence of their quadratic hyperpolarizability beta. The variation of beta was studied using the electric-field-induced second-harmonic (EFISH) generation technique. In each series of homologous compounds, the lengthening of the polyenic conjugation path results in a sharp increase in beta with the number n of double bonds of the polyenic chain. This behaviour leads to very large values of beta for the longest molecules whose length reaches 25 angstrom. A steeper increase of beta was observed when the end groups are weaker electron donors and electron acceptors. Moreover, beta = kn(a) relationships have been established, the a exponent depending on the end groups. Finally, the effect of the introduction of a triple bond in the middle of the polyenic linker has been studied. The replacement of a double bond by a triple bond in the conjugation path leads to smaller beta and to a blue shift of the charge transfer absorption band. However, this phenomenon is modulated by the nature of the end groups. Therefore, in some cases, the presence of the triple bond may advantageously result in a pin of transparency with almost no decrease in beta.