Solution:
If 3∣k, then for any n∈N of the form n=3k+1, the sum of the digits of all positive integers up to n gives remainder 1 modulo 3. As a positive integer is divisible by 3 if and only if the sum of its digits is divisible by 3, no matter how we glue 1,2,…,n, the resulting number is not divisible by 3, hence also not by k. So no appropriate Nk can be chosen.
If 3∤k, write k=2a5b⋅m with gcd(m,10)=1. Let ℓ≥⌊log10(m)⌋+2 be an integer divisible by ϕ(m), so 10ℓ≡1(modm) by Euler-Fermat. By the size constraint of ℓ, we can choose ai∈N for 0≤i<m such that ai≡i(modm) and ai has ℓ digits. Note that all ai are different and can also be chosen to be different from 10max(a,b). Take Nk≥max(10max(a,b),10ℓ). For n≥Nk we glue 1,2,…,n the following way:
(a) We put 10max(a,b) at the end of the glueing, so the glued number ends with max(a,b) zeros, ensuring that the number is divisible by 2a5b.
(b) At the beginning of the number we put a0, then the number 1, then a1,a2,…,am−1 in this order.
(c) We put the remaining numbers in the middle, in an arbitrary order.
Let G0 be the number given by this glueing, and for 1≤i<m let Gi be the number we get from the same glueing, except for swapping a0 and ai. We show that at least one of the integers G0,G1,…,Gm−1 is divisible by m, and as all of them are divisible by 2a5b, one of them will be divisible by k, finishing the proof.
Let d be the number of digits of G0 (and hence of G1,…,Gm−1 as well). Then
Gi−G0=10d−ℓ(ai−a0)+10d−ℓ−1−ℓ⋅i(a0−ai)≡10d−1⋅(ai−a0)⋅(10−1)≡i⋅9⋅10d−1(modm).
So if i is such that −G0≡i⋅9⋅10d−1(modm), then m∣Gi. This choice of i is possible, as m is coprime to both 9 and 10, so the inverse of 9⋅10d−1 exists modulo m. Therefore Gi is a gluing of 1,2,…,n, divisible by k.