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-DFF) has been used to calculate the vertical transition energies and oscillator strengths for the x^1∑g^+→I^1∑u^+ transition in NC2,N (n = 1 -10) and X^1∑ → I^1∑^+ 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.