Using density functional theory, geometries and vibrational frequencies of linear chains NC2nN and HC2n+1N (n = 1~10) have been investigated. Time-dependent density functional theory (TD-DFT) has been used to calculate the vertical transition energies and oscillator strengths for the X 1 Σ +g →11 Σu+ transition in NC2nN (n = 1~10) and X 1Σ + →11Σ+ transition in HC2n+1N (n = 1~7). On the basis of present calculations, the explicit expressions for the size dependence of the excitation energy and the first adiabatic ionization energy in both carbon chains have been suggested.