A discrete model is applied to handle the geometrically nonlinear free and forced vibrations of beams consisting of several different segments whose mechanical characteristics vary in the length direction and contain multiple point masses located at different positions. The beam is presented by an N degree of freedom system (N-Dof). An approach based on Hamilton's principle and spectral analysis is applied, leading to a nonlinear algebraic system. A change of basis from the displacement basis to the modal basis has been performed. The mechanical behavior of the N-Dof system is described in terms of the mass tensor mij, the linear stiffness tensor kij, and the nonlinear stiffness tensor bijkl. The nonlinear vibration frequencies as functions of the amplitude of the associated vibrations in the free and forced cases are predicted using the single mode approach. Once the formulation is established, several applications are considered in this study. Different parameters control the frequency-amplitude dependence curve: the laws that describe the variation of the mechanical properties along the beam length, the number of added masses, the magnitude of excitation force, and so on. Comparisons are made to show the reliability and applicability of this model to non-uniform and non-homogeneous beams in free and forced cases.