Spectral problems for generalized Jacobi matrices