Skip to content

Instantly share code, notes, and snippets.

@dvberkel
Last active December 16, 2015 21:39
Show Gist options
  • Save dvberkel/5501397 to your computer and use it in GitHub Desktop.
Save dvberkel/5501397 to your computer and use it in GitHub Desktop.
Binary Look and Say

Go to magma calculator and paste the binary-look-and-say.magma code in the textarea.

n := 63;
m := MatrixAlgebra(Rationals(), 10) ! [
0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 1, 0, 0, 0, 1, 0, 0,
0, 0, 0, 1, 0, 1, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 1,
0, 0, 0, 0, 0, 0, 0, 1, 0, 1,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0
];
weight := Matrix(Rationals(), 1, 10, [1, 2, 1, 2, 3, 4, 1, 2, 3, 4]);
column := ColumnSubmatrix(m^n,1);
weight * column;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment