This paper focuses on the non-orthogonal multiple access (NOMA) design for a classical two-user multiple access channel (MAC) with finite-alphabet inputs. In contrast to most of existing NOMA designs using continuous Gaussian input distributions, we consider practical quadrature amplitude modulation (QAM) constellations at both transmitters, the sizes of which are assumed to be not necessarily identical.We propose to maximize the minimum Euclidean distance of the received sum-constellation with a maximum likelihood (ML) detector by adjusting the scaling factors (i.e., instantaneous transmitted powers and phases) of both users. The formulated problem is a mixed continuous-discrete optimization problem, which is nontrivial to resolve in general. By carefully observing the structure of the objective function, we discover that Farey sequence can be applied to tackle the formulated problem. However, the existing Farey sequence is not applicable when the constellation sizes of the two users are not the same.Motivated by this, we define a new type of Farey sequence, termed punched Farey sequence. Based on this, we manage to achieve a closed-form optimal solution to the original problem by first dividing the entire feasible region into a finite number of Farey intervals and then taking the maximum over all the possible intervals. The resulting sum-constellation is proved to be a regular QAM constellation of a larger size, and hence a simple quantization receiver can be implemented as the ML detector for the demodulation. Moreover, the superiority of NOMA over time-division multiple access (TDMA) in terms of minimum Euclidean distance is rigorously proved. Furthermore, the optimal rate allocation among the two users is obtained in closed-form to further maximize the obtained minimum Euclidean distance of the received signal subject to a total rate constraint. An asymptotic solution is also derived to reveal more insights on how to allocate the rate to each user. Finally, simulation results are provided to verify our theoretical analysis and demonstrate the merits of the proposed NOMA over existing orthogonal and non-orthogonal designs.Z. Dong is with Shenzhen University, China and he is also with McMaster