Vibration of layered nanobeams with periodic nanostructures