I am trying to find the sequence of the even products of nonnegative integers, m and n, after sorting them. For example, $$1*6=6, 2*3=6, 6*1=6, 3*2= 6$$ What I think is the answer is the sequence is just the even numbers in order repeated by the number of divisors of $2n$. I am having a problem figuring out why this is true. I just personally find it easier to write software than to think mathematically. And I would like help formally understanding if this is true and why it is true if it is true.
This problem arose because I was doing a simulation of the 2-player card game War with a deck with $m-suits$ and $n-values$. But generating the allowed $m$ and $n$ that gives a deck that can be divided evenly isn't easy, and I had to check to see if $mn$ was even.
So, playing around with Mathematica and this on OEIS, I think I found 2 software programs that both calculate the sequence of ordered products of nonnegative integers.
The functions are:
createSortedEvenProducts1[n_]:=(allCombinations=Flatten[Table[Table[{i,j,i*j},{i,1,2*n}],{j,1,2*n}],1];evenProductCombinations={};Table[If[EvenQ[allCombinations[[i,3]]]==True,AppendTo[evenProductCombinations,allCombinations[[i]]],None],{i,1,Length[allCombinations]}];sortedEvenProducts=Take[Map[Last,SortBy[evenProductCombinations, N@*Last]],Length[Flatten[Table[Table[2n,{i,1,DivisorSigma[0,2 j]}],{j,1,n}]]]])
and
createSortedEvenProducts2[n_]:=Flatten[Table[Table[2*j,{i,1,DivisorSigma[0,2 *j]}],{j,1,n}]];
Both createSortedEvenProducts1[10] and createSortedEvenProducts2[10] give:
{2,2,4,4,4,6,6,6,6,8,8,8,8,10,10,10,10,12,12,12,12,12,12,14,14,14,14,16,16,16,16,16,18,18,18,18,18,18,20,20,20,20,20,20}.
I have to say, it is a little hard for me to figure out how you can doubt your conclusion, as it seems obvious to me. But different people have different strengths, so here we go:
First of all, it is restricted to positive even integers by your choice. Every integer is the product of itself and $1$, so every positive even integer must have an entry in your list. So it consists of all the positive even integers. And again, they are sorted by your choice. So it is a list of all the positive even integers in order.
Now for a given even integer $k > 0$, the number of repetitions of $k$ is the list will be the number of distinct ways that $k$ can be expressed as a product of a pair $(a,b)$ of positive integers: $k = a\times b$. But if $k = a \times b$ and $k = a \times c$, then $b = \frac ka = c$, so $b$ and $c$ are the same. That is, each pair is completely determined by $a$ alone. So what $a$ are possible? The condition that there is a $b$ such that $a \times b = k$ is exactly the definition of "$a$ is a divisor of $k$". So the set of all $a$ in the pairs is the exactly the set of divisors of $k$. There will be as many repetitions of $k$ in your list as $k$ has divisors.
Note that there is nothing peculiar to even integers here. The same statement, other than the "even" - would be true if you looked at all positive integers, or if you looked at positive odd integers, or some other set of postive integers. If you replaced "positive" with "non-zero", it would still all be true (though you would get double the number of repetitions, as you've doubled the number of divisors).
But if you drop "non-zero", suddenly your list will have an infinite number of $0$ entries between the positives and the negatives, as all integers are divisors of $0$.