The addition of variable numbers of random nucleotides by terminal deoxytransferase in the N regions of heavy chain immunoglobulin and T cell receptor genes. N regions are found at the V-D, D-D, V-J, and D-J recombinational junctions, depending on the immune receptor gene.