The H(NH(2)BH(2))(n)H oligomers are possible products from dehydrogenation of ammonia borane (NH(3)BH(3)) and ammonium borohydride (NH(4)BH(4)), which belong to a class of boron-nitrogen-hydrogen (BNH(x)) compounds that are promising materials for chemical hydrogen storage. Understanding the kinetics and reaction pathways of formation of these oligomers and their further dehydrogenation is essential for developing BNH(x)-based hydrogen storage materials. We have performed computational modeling using density functional theory (DFT), ab initio wave function theory, and Car-Parrinello molecular dynamics (CPMD) simulations on the energetics and formation pathways for the H(NH(2)BH(2))(n)H (n = 1-4) oligomers, polyaminoborane (PAB), from NH(3)BH(3) monomers and the subsequent dehydrogenation steps to form polyiminoborane (PIB). Through computational transition state searches and evaluation of the intrinsic reaction coordinates, we have investigated the B-N bond cleavage, the reactions of NH(3)BH(3) molecule with intermediates, dihydrogen release through intra- and intermolecular hydrogen transfer, dehydrocoupling/cyclization of the oligomers, and the dimerization of NH(3)BH(3) molecules. We find that the formation of H(NH(2)BH(2))(n+1)H oligomers occurs first through reactions of the H(NH(2)BH(2))(n)H oligomers with BH(3) followed by reactions with NH(3) and the release of H(2), where the BH(3) and NH(3) intermediates are formed through dissociation of NH(3)BH(3). We also find that the dimerization of the NH(3)BH(3) molecules to form cyclic c-(NH(2)BH(2))(2) is slightly exothermic, with an unexpected transition state that leads to the simultaneous release of two H(2) molecules. The dehydrogenations of the oligomers are also exothermic, typically by less than 10 kcal/(mol of H(2)), with the largest exothermicity for n = 3. The transition state search shows that the one-step direct dehydrocoupling cyclization of the oligomers is not a favored pathway because of high activation barriers. The dihydrogen bonding, in which protic (H(N)) hydrogens interact with hydridic (H(B)) hydrogens, plays a vital role in stabilizing different structures of the reactants, transition states, and products. The dihydrogen interaction (DHI) within the R-BH(2)(eta(2)-H(2)) moiety accounts for both the formation mechanisms of the oligomers and for the dehydrogenation of ammonia borane.