← RoseCode

ROSECODE 205

Laver Tables

Philippe_57721 · Programming ·

Laver tables, discovered by Richard Laver, are very intriguing mathematical objects.

Although their definition is elementary, some of their properties cannot be proved in the classical set theory (ZFC), but require (so far) some hypotheses about large cardinals.

Let's define the operation ⊗ for integers in range [1..n] (n is a power of 2) by the following axioms:
x ⊗ 1 = 1 + (x modulo n)
x ⊗ (y ⊗ z) = (x ⊗ y) ⊗ (x ⊗ z)

Here is the Laver table for n = 8:
    1   2   3   4   5   6   7   8
  + - + - + - + - + - + - + - + - +
1 | 2 | 4 | 6 | 8 | 2 | 4 | 6 | 8 |
  + - + - + - + - + - + - + - + - +
2 | 3 | 4 | 7 | 8 | 3 | 4 | 7 | 8 |
  + - + - + - + - + - + - + - + - +
3 | 4 | 8 | 4 | 8 | 4 | 8 | 4 | 8 |
  + - + - + - + - + - + - + - + - +
4 | 5 | 6 | 7 | 8 | 5 | 6 | 7 | 8 |
  + - + - + - + - + - + - + - + - +
5 | 6 | 8 | 6 | 8 | 6 | 8 | 6 | 8 |
  + - + - + - + - + - + - + - + - +
6 | 7 | 8 | 7 | 8 | 7 | 8 | 7 | 8 |
  + - + - + - + - + - + - + - + - +
7 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 8 |
  + - + - + - + - + - + - + - + - +
8 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
  + - + - + - + - + - + - + - + - +
You'll notice that, except for the last one, all rows are periodic.

Find the periodic part of the 1st row for n = 2^16.

Answer format: comma delimited list of values

Example: For n = 8, the anwser would be: 2,4,6,8

N.B:
It can be proved that the periodicity of the 1st row is unbounded.
But the first n for which the period is greater that the one you'll find for 2^16 is greater than A(9,A(8,A(8,255)))
A is the Ackerman function ...
[My timing: < 1s]