OFFSET
0,1
COMMENTS
The clock has 3 bars with lengths 5, 11, 11. So the minimal number of balls is (5+11+11) + 1 = 27. But it can also operate with more balls, hence the (27+n) in sequence name.
To get the above data, first call PARI script clock() (A221616) with n = 0, 1, ..., and send the result into the orderp() script below. The order of a permutation is computed with the LCM of cycle sizes.
LINKS
ACM International Collegiate Programming Contest, 1995 ACM-ICPC World Finals Problems
Jim Weigang, Ball Clock Problem
PROG
(PARI) orderp(v) = {nv = length(v); vbp = vector(nv); ordr = 1; for (i=1, nv, if (vbp[i] == 0, cpt = 0; j = i; while (vbp[j] == 0, nextj = v[j]; vbp[j] = 1; j = nextj; cpt++; ); ordr = lcm(ordr, cpt); ); ); return(ordr); }
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Jan 21 2013
STATUS
approved