Answer. n=2k−1 for any k∈N.
We begin by noting that the sequence is given by the formula
arn+s=r⋅(2n+1)+(2s+1)
for all ≥0 and s=1,2,…,n. This is easy to confirm by mathematical induction: a0=0 is true, and for fixed r, inducting on s gives
arn+s=arn+s−1+s=r⋅(2n+1)+(2(s−1)+1)+s=r⋅(2n+1)+(2s+1),
proving this induction step. Finally, a(r+1)n=(r+1)(2n+1)=r⋅(2n+1)+(2n+1)=arn+n, confirming the induction argument on r as well, proving the claim.
Now suppose n+1 has an odd prime factor p. Then p∣(2n+1), so if all residues mod (n+1)2 are present, then (2s+1)≡2s2+s(modp) covers all possible residues mod p. However, the map x↦x2+x(modp) sends x and −(1+x) to the same element mod p and the two are distinct unless x≡2−1(modp), hence the set of residues represented by s2+s(modp) has 2p+1<p elements, a contradiction! So every n that satisfies this condition must be one less than a power of 2.
Now we prove that all n one less than powers of 2 satisfy the condition. Let n=2k−1. Then (2n+1)=2k−1(2k−1)=22k−1−2k−1(mod22k). Then, if for 0≤r and 1≤s≤n, and r=2j+e, where e∈{0,1}, then
arn+s=−j⋅(n+1)+e⋅(2n+1)+(2s+1)(mod(n+1)2).
Notice that for s=1,2,…,n, the numbers (2s+1) are all distinct mod n+1. Indeed, if 1≤s<t≤n and (2s+1)=(2t+1)(modn+1), then (2n+2)∣(s−t)(s+t+1), and since s,t have opposite parities and 2n+2>2n+1≥s+t+1>∣s−t∣>0, we arrive at a contradiction as 2n+2 is a power of 2, proving that the residues are distinct mod n+1. Also, note that none of these residues are 0 (mod n+1). Thus, −j(n+1)+(2s+1) (where e=0) covers all n2+n residues which are not of the form l(n+1)(mod(n+1)2).
Finally, for the remaining residues, take s=n and e=1, we get −j(n+1)+2(2n+1)=−(j+1)(n+1)(mod(n+1)2), so that which covers the remaining residues as j varies. □