Solution:
Let L=lcm(1,2,3,…,n), and let E=L(1+21+31+⋯+n1) denote the expression.
In order for n to be quixotic, we need E≡0 (mod 5) and E≡0 (mod 9). We consider these two conditions separately.
Claim: E≡0 (mod 5) if and only if n∈[4⋅5k,5k+1) for some nonnegative integer k.
Proof. Let k=⌊log5n⌋, which is equal to ν5(L). In order for E to be divisible by 5, all terms in 1L,2L,…,nL that aren't multiples of 5 must sum to a multiple of 5. The potential terms that are not going to be multiples of 5 are L/5k,L/(2⋅5k),L/(3⋅5k), and L/(4⋅5k), depending on the value of n.
- If n∈[5k,2⋅5k), then only L/5k appears. Thus, the sum is L/5k, which is not a multiple of 5.
- If n∈[2⋅5k,3⋅5k), then only L/5k and L/(2⋅5k) appear. The sum is 3L/(2⋅5k), which is not a multiple of 5.
- If n∈[3⋅5k,4⋅5k), then only L/5k,L/(2⋅5k), and L/(3⋅5k) appear. The sum is 11L/(6⋅5k), which is not a multiple of 5.
- If n∈[4⋅5k,5k+1), then L/5k,L/(2⋅5k),L/(3⋅5k), and L/(4⋅5k) all appear. The sum is 25L/(12⋅5k), which is a multiple of 5. Thus, this case works.
Only the last case works, implying the claim.
Claim: E≡0 (mod 9) if and only if n∈[7⋅3k−1,8⋅3k−1) for some positive integer k.
Proof. This is a repeat of the previous proof, so we will only sketch it. Let k=⌊log3n⌋, which is equal to ν3(L). This time, the terms we need to consider are those that are not multiples of 9, which are
3k−1L,2⋅3k−1L,⋯,8⋅3k−1L
Similar to the above, we need to check that the sum of the first j terms is divisible by 9 if and only if j=7. There are 8 cases, but we could reduce workload by showing first that it is divisible by 3 if and only if j∈{6,7,8} (there are only L/3k and L/(2⋅3k) to consider), then eliminate 6 and 8 by using (mod 9).
Doing a little bit of arithmetic, we'll get the first 10 quixotic numbers: 21,22,23,567,568,569,570,571,572,573.