The values of j in question are those not divisible by either 42 or 46.
We first check that for p prime,
n=1∑p−1nj≡0(modp)⇔j≡0(modp−1).
If j≡0(modp−1), then nj≡1(modp) for each n, so ∑n=1p−1nj≡p−1(modp). If j≡0(modp−1), we can pick a primitive root m modulo p,
observe that mj≡1(modp), and then note that
n=1∑p−1nj≡n=1∑p−1(mn)j=mjn=1∑p−1nj(modp),
which is only possible if ∑n=1p−1nj≡0(modp).
We now note that the prime factorization of 2021 is 43×47,
so it suffices to determine when S(j) is divisible by each of 43 and 47.
We have
S(j)S(j)≡46n=1∑42nj(mod43)≡42n=1∑46nj(mod47).
Since 46 and 42 are coprime to 43 and 47, respectively,
we have
S(j)≡0(mod43)⇔j≡0(mod42)S(j)≡0(mod47)⇔j≡0(mod46).
This yields the claimed result.