I am studying a special type of a sequence on the naturals which I am calling a weak arithmetic progression. Formally I call a k-sequence $x_1<x_2<\cdots< x_k$ a weak arithmetic progression (WAP) if $\exists d\in \mathbb{N}$ such that $x_{i+1}-x_i\in\{1,d\}$. Now given two natural numbers $n\ge k\ge 1$, I wish to count the number of WAP's of length k within $\{1,2,3\ldots, n\}$, i.e. the number of WAP's of length k where each WAP consists of elements from $\{1,2\cdots n\}$. This is how I am reasoning:
First fix a $d$. Consider any collection of $k$ numbers (as yet identified as $x_1,\cdots x_k$) and write them with spaces in the middle. We will count in how many ways we can put either $d$ or $1$ in the $k-1$ spaces or gaps between these numbers. Now if all the $k-1$ gaps between the numbers have to be filled up by $d$, then the first element of the $k$-WAP can be chosen in $n-(k-1)d$ ways. I will refer to this as $(n-(k-1)d)\tbinom{k-1}{0}$. If all but one of the gaps between the numbers have to be filled up by $d$, then there are $(n-(k-2)d-1)\tbinom{k-1}{1}$ ways, the binomial coefficient indicating where to place the number $1$ in the $k-1$ gaps. Likewise for all but $r$ gaps being filled up by $d$ there would be $(n-(k-r-1)d-r)\tbinom{k-1}{r}$ ways and so for a fixed $d$ there are $\sum_{r=0}^{k-1}(n-(k-r-1)d-r)\tbinom{k-1}{r}=(n-d(k-1))2^{k-1}+(d-1)(k-1)2^{k-2}$ $k$-WAPs. Now to get the total number of $k$-WAPs I sum over $d$ from $2$ to $n-k+1$, i.e. $\sum_{d=2}^{n-k+1}\Big ((n-d(k-1))2^{k-1}+(d-1)(k-1)2^{k-2}\Big )$ and furthermore since double counting of consecutive k-terms occurs for each $d$ in this sum, we subtract $(n-k+1)(n-k-1)$, i.e the final answer is $\sum_{d=2}^{n-k+1}\Big((n-d(k-1))2^{k-1}+(d-1)(k-1)2^{k-2}\Big )-(n-k-1)(n-k+1)$.
My questions are:
- Is the above reasoning correct? If not, then what is the correct approach?
- What is a good upper bound for the above sum which can be solved for $n$? I need $n$ as a function of $k$ for further study.
Thanks