Sets of consecutive integers from 0 are closed under nim-multiplication when their cardinalities are Fermat 2-powers 2, 4, 16, 256, 65536... (A001146)
So useful nim-multiplication tables are square matrices of size .
Their rows are -bit Walsh permutations, and the corresponding compression vectors give a matrix.
The columns of this matrix are again Walsh permutations.
Their compression vectors give a square matrix of size , which is thus a compression of the multiplication table.
(Of course there is no Walsh permutation wp(zeros), but here it makes sense to write it that way.)
There is another -bit Walsh permutation corresponding to each multiplication table, which is the bitwiseXOR of the other ones. Its compression vector is the bitwise XOR of their compression vectors.
In the table above it can be seen that all rows (in the nim-multiplication table and in the table of compression vectors) are bit-XORs of 2-power rows.
(So both columns and rows of the beige square matrix appear as compression vectors.)
Further it can be seen that the nim-products of 2-powers are related to the compression vectors on the right.
(Read the compression matrices on the right row by row instead of column by column.)
So in the end all the information in the table of nim-products is compressed in the table of nim-products of 2-powers.
Demonstration in Matlab
Two calculations of the 256x256 nim-multiplication table, here called WP:
WP1 is calculated from the compressed matrix B and WP2 with a recursive function calculating all 256*256 nim-products.
It can be seen that there is also an extreme difference in speed.
>>BB=12481632641282381232481281928125101281928016012410151926416024019264160240173468136641282408034511362042408096176136204851708016017620820468170255>>%%%%% Calculation of WP1:>>>>ticCV=zeros(256,8);form=1:8CV(1:256,m)=cv2wp(B(:,m)')';% Take the columns of B as compression vectors and turn them into Walsh permutations, which go to the columns of CV.endWP1=zeros(256);form=2:256WP1(m,1:256)=cv2wp(CV(m,:));% Take the rows of CV as compression vectors and turn them into Walsh permutations, which go to the rows of WP1.endtocElapsedtimeis0.688750seconds.>>>>%%%%% Extract of the 256x8 matrix CV:>>>>[num2str([0:17]')repmat(' ',18,10)num2str(CV(1:18,:))]ans=00000000011248163264128% Row 0 of B (Would be called B(1,:) in Matlab.)2238123248128192% Row 1 of B331124481619264481251012819280160% Row 2 of B59141214422416326101513616024020896711139141762081442248124101519264160240% Row 3 of B91361472089622411210147232241123248111556112408096176124815564128240801351011138016017620814611799617611214415793111214448161619264160240173468136%Row4ofB17193661642481248>>%%%%% Calculation of WP2:>>>>>>ticWP2=zeros(256);form=1:256forn=1:256WP2(m,n)=nimprod(m-1,n-1);endendtocElapsedtimeis730.700629seconds.>>>>%%%%% Compare:>>>>isequal(WP1,WP2)% Are WP1 and WP2 equal?ans=1% Yes.
The multiplication table of the nimbers 0..255 is here.
The 8 elements of the dual matrix are here.
The rows of Matrix A are treated as compression vectors. They are transformed into the corresponding compression matrices. Than these matrices are transposed. The compression vectors corresponding to the transposed matrices are the rows of Matrix B.
Here is a closer look at the nim-products of the first 16 powers of 2 (A223541).
It shows the binary representation of the entries and the dual matrix where bits with the same position are shown together:
Representation as binary tensors
Although it is hard to see, each tensor can be produced from the other one by rotation.
The compressed multiplication table of the first 256 nimbers (A223537):
Read by rows these are the compression vectors of rows 1,2,4,8,...,128.
The diagonal is A001317 (Sierpinski triangle rows read like binary numbers).