Proof that A340518(n) is even. By Lagrange's theorem, if n is even then a(n) is necessarily even. Hence we only have to consider the case when n is odd. We will show that every dihedral group D of order 2*m for odd m > 1 has a commutator subgroup D' of order m. Hence, every commutator subgroup of odd order m > 1 underlying A340518(m) is the cyclic group of order m. As every D of order greater than 4 is non-abelian, |D'| > 1. Now, C_2 is a Sylow subgroup of D; further, D contains a normal, cyclic Sylow subgroup H of order m, corresponding to the m rotational and reflection symmetries of a regular m-sided polygon. As the quotient D/H is isomorphic to C_2, D/H is therefore abelian; consequently H must be a subgroup of D', and |H| <= |D'|. But since |H| = m, |D| = 2*m, and |D'| < |D|, therefore |H| = |D'|. Hence every cyclic group of odd order m > 1 appears as the commutator subgroup of the dihedral group of order 2*m. As no odd order groups are perfect, 2*m is the smallest possible order for any group containing a commutator subgroup order m, and therefore a(n) = 2*n for odd n > 1, and the conjecture is true.