In this paper we prove that there exists an absolute constant c > 0 such that for every natural number k, every non-bipartite 2-connected graph with average degree at least ck contains k cycles with consecutive odd lengths. This implies the existence of the absolute constant d > 0 that every non-bipartite 2-connected graph with minimum degree at least dk contains cycles of all lengths modulo k, thus providing an answer (in a strong form) to a question of Thomassen in [14]. Both results are sharp up to the constant factors.