Bosonic Hamiltonian generalized to N harmonic oscillators