Ostinato
In music, an ostinato is a short pattern of notes which is repeated several times throughout a song or piece of music. The word "ostinato" is related to the word obstinate. It is like a musical idea which is being obstinate and will not go away. The plural can be either "ostinati" or "ostinatos".
An ostinato can last for a section of a piece or it might last for the whole piece of music.
An ostinato can be a repeated group of notes or just a rhythm. It is similar to a riff in jazz. Many kinds of music use ostinati, e.g. classical music, jazz, boogie-woogie and African music.
A ground bass, or basso ostinato, is an ostinato pattern in the lowest notes, which keeps playing while the melodies in the higher notes change. This was often used in baroque musical works. An example is the famous Canon in D by Pachelbel.
An example of a rhythmic ostinato is the first movement from the Planets Suite by Gustav Holst. This is the movement in 5/4 time which describes Mars. Boléro by Maurice Ravel also uses a repeated rhythm all the way through the piece.
An example from popular music is Pink Floyd's Money.