The superconductivity of the 4-angstrom single-walled carbon nanotubes (SWCNTs) was discovered more than a decade ago, and marked the breakthrough of finding superconductivity in pure elemental undoped carbon compounds. The van Hove singularities in the electronic density of states at the Fermi level in combination with a large Debye temperature of the SWCNTs are expected to cause an impressively large superconducting gap. We have developed an innovative computational algorithm specially tailored for the investigation of superconductivity in ultrathin SWCNTs. We predict the superconducting transition temperature of various thin carbon nanotubes resulting from electron-phonon coupling by an ab-initio method, taking into account the effect of radial pressure, symmetry, chirality (N,M) and bond lengths. By optimizing the geometry of the carbon nanotubes, a maximum Tc of 60K is found. We also use our method to calculate the Tc of a linear carbon chain embedded in the center of (5,0) SWCNTs. The strong curvature in the (5,0) carbon nanotubes in the presence of the inner carbon chain provides an alternative path to increase the Tc of this carbon composite by a factor of 2.2 with respect to the empty (5,0) SWCNTs.