Let f(x)=∑k=2p⌊logkx⌋ and let M={f(x)∣x∈[a,a+n]}. It is easy to show that if k≥2 is a positive integer, then ⌊logk⌊x⌋⌋=⌊logkx⌋. This implies that f(x)=f(⌊x⌋), for all x∈[1,∞), and hence M={f(x)∣x∈S}, where S={⌊a⌋,⌊a⌋+1,…,⌊a⌋+n} has n+1 elements. On the other hand, for s∈S, s<⌊a⌋+n≤p, we have s+1∈{2,3,…,p}, and
f(s+1)−f(s)=k=2∑p(⌊logk(s+1)⌋−⌊logks⌋)≥⌊logs+1(s+1)⌋−⌊logs+1s⌋=1,
therefore f(s+1)>f(s), and this proves that M has exactly n+1 elements.