OFFSET
0,3
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..5039 (n = 0..7!-1)
EXAMPLE
L_0 = (0, 1, 2, 3, 4, 5, ...)
L_1 = (0, 1, 2, 3, 4, 5, ...)
L_2 = (0, 1, 3, 2, 4, 5, ...)
As 5 < k! for k > 2, we have:
- a(0) = 0,
- a(1) = 1,
- a(2) = 3,
- a(3) = 2,
- a(4) = 4,
- a(5) = 5.
PROG
(PARI) a(n) = { for (k=1, oo, if (n<k!, while (k, my (q=n\k!, r=n%k!); if (q%2, n=(q+1)*k!-1-r; ); k--); return (n))) }
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, May 11 2020
STATUS
approved