OFFSET
1,9
COMMENTS
For modulo 24, imagine you need to be present at work at 23:00 and at 04:00, then you only have to be there for 5 hours, not 19 (=23-4).
LINKS
Sean A. Irvine, Table of n, a(n) for n = 1..496
EXAMPLE
T(4,3)=2 because modsort mod 4 on {{1,2,3},{1,2,4},{1,3,4},{2,3,4}} produces {{1,2,3},{4,1,2},{3,4,1},{2,3,4}} with 2 changes. modsort on {1,2,4} gives {4,1,2} since it has intervals (4 to 1 gives 1) and (1 to 2 gives 1), while (2 to 4 gives 2) is excluded.
MATHEMATICA
modsort[li_List, n_] := Block[{temp}, RotateRight[Sort[li], Length[li]-Position[temp=Mod[ #2-#1, n, 0]& @@@ Partition[Sort[li], 2, 1, {1, 1}], Max[temp]][[ -1, 1]] ]]; << DiscreteMath`Combinatorica`; Table[Count[modsort[ #, n]& /@ KSubsets[Range[n], k], _?(!OrderedQ[ # ]&)], {n, 16}, {k, n}]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Wouter Meeussen, Sep 05 2002
STATUS
approved