Differences between revisions 2 and 3
 ⇤ ← Revision 2 as of 2005-12-17 01:33:08 → Size: 967 Editor: RogerHui Comment: authorship ← Revision 3 as of 2008-12-08 10:45:39 → ⇥ Size: 967 Editor: anonymous Comment: converted to 1.6 markup Deletions are marked like this. Additions are marked like this. Line 26: Line 26: [[BR]] <
>

Find an interesting use of *./ on a list of integers with length greater than 2.

Solution:

The LCM of the cycle lengths of a permutation p is period of p , the size of the subgroup generated by p . For example:

```   ] p=: ?.~ 23
4 22 16 15 18 14 7 8 0 21 3 13 20 9 11 19 6 17 2 5 1 10 12
C. p
┌──┬─────────────────┬──────────────────────────┬──────────┐
│17│18 2 16 6 7 8 0 4│21 10 3 15 19 5 14 11 13 9│22 12 20 1│
└──┴─────────────────┴──────────────────────────┴──────────┘
#&> C. p
1 8 10 4
*./ #&> C. p
40
# ~. {/\ (100,#p)\$p
40
p&{^:40 i.#p
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22```

Contributed by RogerHui.

Puzzles/LCM (last edited 2008-12-08 10:45:39 by anonymous)