In this paper, we prove a tight minimum degree condition in general graphs for the existence of paths between two given endpoints whose lengths form a long arithmetic progression with common difference one or two. This allows us to obtain a number of exact and optimal results on cycle lengths in graphs of given minimum degree, connectivity or chromatic number.
More precisely, we prove the following statements by a unified approach: 1. Every graph $G$ with minimum degree at least $k+1$ contains cycles of all even lengths modulo $k$; in addition, if $G$ is $2$-connected and non-bipartite, then it contains cycles of all lengths modulo $k$. 2. For all $kgeq 3$, every $k$-connected graph contains a cycle of length zero modulo $k$. 3. Every $3$-connected non-bipartite graph with minimum degree at least $k+1$ contains $k$ cycles of consecutive lengths. 4. Every graph with chromatic number at least $k+2$ contains $k$ cycles of consecutive lengths. The 1st statement is a conjecture of Thomassen, the 2nd is a conjecture of Dean, the 3rd is a tight answer to a question of Bondy and Vince, and the 4th is a conjecture of Sudakov and Verstrate. All of the above results are best possible.