# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a221617 Showing 1-1 of 1 %I A221617 #12 Jun 25 2021 22:43:21 %S A221617 25,27,84,380,138,24,180,140,330,627,1190,200,252,420,399,1020,6160, %T A221617 74,148,360,47,5460,870,1160,748,1508,680,147,1260,1596,1092,3220,140, %U A221617 57,270,2436,440,840,62,177,1260,840,54,4641,244,21840,228,644,1320,3795,1980,4620,2976,34410,12012,550,5700,12243,1155,120120,249 %N A221617 Number of 12-hour periods after which the (27+n) balls of a ball clock return to their initial state. %C A221617 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. %C A221617 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. %H A221617 ACM International Collegiate Programming Contest, 1995 ACM-ICPC World Finals Problems %H A221617 Jim Weigang, Ball Clock Problem %o A221617 (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);} %Y A221617 Cf. A221616. %K A221617 nonn %O A221617 0,1 %A A221617 _Michel Marcus_, Jan 21 2013 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE