Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Search: a056019 -id:a056019
     Sort: relevance | references | number | modified | created      Format: long | short | data
Minimal number of factorials that add to n.
+10
81
0, 1, 1, 2, 2, 3, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7
OFFSET
0,4
COMMENTS
Equivalently, sum of digits when n is written in factorial base (A007623).
Equivalently, a(0)...a(n!-1) give the total number of inversions of the permutations of n elements in lexicographic order (the factorial numbers in rising base are the inversion tables of the permutations and their sum of digits give the total number of inversions, see example and the Fxtbook link). - Joerg Arndt, Jun 17 2011
Also minimum number of adjacent transpositions needed to produce each permutation in the list A055089, or number of swappings needed to bubble sort each such permutation. (See A055091 for the minimum number of any transpositions.)
LINKS
F. T. Adams-Watters and F. Ruskey, Generating Functions for the Digital Sum and Other Digit Counting Sequences, JIS 12 (2009) 09.5.6.
Joerg Arndt, Matters Computational (The Fxtbook), fig.10-1.B on p.234.
Tyler Ball, Joanne Beckford, Paul Dalenberg, Tom Edgar, and Tina Rajabi, Some Combinatorics of Factorial Base Representations, J. Int. Seq., Vol. 23 (2020), Article 20.3.3.
FindStat - Combinatorial Statistic Finder, The number of inversions of a permutation
FORMULA
a(n) = n - Sum_{i>=2} (i-1)*floor(n/i!). - Benoit Cloitre, Aug 26 2003
G.f.: 1/(1-x)*Sum_{k>0} (Sum_{i=1..k} i*x^(i*k!))/(Sum_{i=0..k} x^(i*k!)). - Franklin T. Adams-Watters, May 13 2009
From Antti Karttunen, Aug 29 2016: (Start)
a(0) = 0; for n >= 1, a(n) = A099563(n) + a(A257687(n)).
a(0) = 0; for n >= 1, a(n) = A060130(n) + a(A257684(n)).
Other identities. For all n >= 0:
a(n) = A001222(A276076(n)).
a(n) = A276146(A225901(n)).
a(A000142(n)) = 1, a(A007489(n)) = n, a(A033312(n+1)) = A000217(n).
a(A056019(n)) = a(n).
A219651(n) = n - a(n).
(End)
EXAMPLE
a(205) = a(1!*1 + 3!*2 + 4!*3 + 5!*1) = 1+2+3+1 = 7. [corrected by Shin-Fu Tsai, Mar 23 2021]
From Joerg Arndt, Jun 17 2011: (Start)
n: permutation inv. table a(n) cycles
0: [ 0 1 2 3 ] [ 0 0 0 ] 0 (0) (1) (2) (3)
1: [ 0 1 3 2 ] [ 0 0 1 ] 1 (0) (1) (2, 3)
2: [ 0 2 1 3 ] [ 0 1 0 ] 1 (0) (1, 2) (3)
3: [ 0 2 3 1 ] [ 0 1 1 ] 2 (0) (1, 2, 3)
4: [ 0 3 1 2 ] [ 0 2 0 ] 2 (0) (1, 3, 2)
5: [ 0 3 2 1 ] [ 0 2 1 ] 3 (0) (1, 3) (2)
6: [ 1 0 2 3 ] [ 1 0 0 ] 1 (0, 1) (2) (3)
7: [ 1 0 3 2 ] [ 1 0 1 ] 2 (0, 1) (2, 3)
8: [ 1 2 0 3 ] [ 1 1 0 ] 2 (0, 1, 2) (3)
9: [ 1 2 3 0 ] [ 1 1 1 ] 3 (0, 1, 2, 3)
10: [ 1 3 0 2 ] [ 1 2 0 ] 3 (0, 1, 3, 2)
11: [ 1 3 2 0 ] [ 1 2 1 ] 4 (0, 1, 3) (2)
12: [ 2 0 1 3 ] [ 2 0 0 ] 2 (0, 2, 1) (3)
13: [ 2 0 3 1 ] [ 2 0 1 ] 3 (0, 2, 3, 1)
14: [ 2 1 0 3 ] [ 2 1 0 ] 3 (0, 2) (1) (3)
15: [ 2 1 3 0 ] [ 2 1 1 ] 4 (0, 2, 3) (1)
16: [ 2 3 0 1 ] [ 2 2 0 ] 4 (0, 2) (1, 3)
17: [ 2 3 1 0 ] [ 2 2 1 ] 5 (0, 2, 1, 3)
18: [ 3 0 1 2 ] [ 3 0 0 ] 3 (0, 3, 2, 1)
19: [ 3 0 2 1 ] [ 3 0 1 ] 4 (0, 3, 1) (2)
20: [ 3 1 0 2 ] [ 3 1 0 ] 4 (0, 3, 2) (1)
21: [ 3 1 2 0 ] [ 3 1 1 ] 5 (0, 3) (1) (2)
22: [ 3 2 0 1 ] [ 3 2 0 ] 5 (0, 3, 1, 2)
23: [ 3 2 1 0 ] [ 3 2 1 ] 6 (0, 3) (1, 2)
(End)
MAPLE
[seq(convert(fac_base(j), `+`), j=0..119)]; # fac_base and PermRevLexUnrank given in A055089. Perm2InversionVector in A064039
Or alternatively: [seq(convert(Perm2InversionVector(PermRevLexUnrank(j)), `+`), j=0..119)];
# third Maple program:
b:= proc(n, i) local q;
`if`(n=0, 0, b(irem(n, i!, 'q'), i-1)+q)
end:
a:= proc(n) local k;
for k while k!<n do od; b(n, k)
end:
seq(a(n), n=0..200); # Alois P. Heinz, Nov 15 2012
MATHEMATICA
a[n_] := Module[{s=0, i=2, k=n}, While[k > 0, k = Floor[n/i!]; s = s + (i-1)*k; i++]; n-s]; Table[a[n], {n, 0, 105}] (* Jean-François Alcover, Nov 06 2013, after Benoit Cloitre *)
PROG
(PARI) a(n)=local(k, r); k=2; r=0; while(n>0, r+=n%k; n\=k; k++); r \\ Franklin T. Adams-Watters, May 13 2009
(Scheme)
(define (A034968 n) (let loop ((n n) (i 2) (s 0)) (cond ((zero? n) s) (else (loop (quotient n i) (+ 1 i) (+ s (remainder n i)))))))
;; Antti Karttunen, Aug 29 2016
(Python)
def a(n):
k=2
r=0
while n>0:
r+=n%k
n=n//k
k+=1
return r
print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 19 2017, after PARI program
CROSSREFS
Cf. A368342 (partial sums), A001809 (sums of n! terms).
Cf. A227148 (positions of even terms), A227149 (of odd terms).
Differs from analogous A276150 for the first time at n=24.
Positions of records are A200748.
KEYWORD
nonn
EXTENSIONS
Additional comments from Antti Karttunen, Aug 23 2001
STATUS
approved
List of all finite permutations in reversed colexicographic ordering.
+10
71
1, 2, 1, 1, 3, 2, 3, 1, 2, 2, 3, 1, 3, 2, 1, 1, 2, 4, 3, 2, 1, 4, 3, 1, 4, 2, 3, 4, 1, 2, 3, 2, 4, 1, 3, 4, 2, 1, 3, 1, 3, 4, 2, 3, 1, 4, 2, 1, 4, 3, 2, 4, 1, 3, 2, 3, 4, 1, 2, 4, 3, 1, 2, 2, 3, 4, 1, 3, 2, 4, 1, 2, 4, 3, 1, 4, 2, 3, 1, 3, 4, 2, 1, 4, 3, 2, 1, 1, 2, 3, 5, 4, 2, 1, 3, 5, 4, 1, 3, 2, 5, 4, 3, 1, 2
OFFSET
0,2
FORMULA
[seq(op(PermRevLexUnrank(j)), j=0..)]; (see Maple code given below).
EXAMPLE
In this table, each row consists of A001563(n) permutations of n+1 terms; i.e., we have (1/) 2,1/ 1,3,2; 3,1,2; 2,3,1; 3,2,1/ 1,2,4,3; 2,1,4,3; ... .
Append to each an infinite number of fixed terms and we get a list of rearrangements of the natural numbers, but with only a finite number of terms permuted:
1/2,3,4,5,6,7,8,9,...
2,1/3,4,5,6,7,8,9,...
1,3,2/4,5,6,7,8,9,...
3,1,2/4,5,6,7,8,9,...
2,3,1/4,5,6,7,8,9,...
3,2,1/4,5,6,7,8,9,...
1,2,4,3/5,6,7,8,9,...
2,1,4,3/5,6,7,8,9,...
Alternatively, if we take only the first n terms of each such infinite row, then the first n! rows give all permutations of the elements 1,2,...,n.
MAPLE
factorial_base := proc(nn) local n, a, d, j, f; n := nn; if(0 = n) then RETURN([0]); fi; a := []; f := 1; j := 2; while(n > 0) do d := floor(`mod`(n, (j*f))/f); a := [d, op(a)]; n := n - (d*f); f := j*f; j := j+1; od; RETURN(a); end;
fexlist2permlist := proc(a) local n, b, j; n := nops(a); if(0 = n) then RETURN([1]); fi; b := fexlist2permlist(cdr(a)); for j from 1 to n do if(b[j] >= ((n+1)-a[1])) then b[j] := b[j]+1; fi; od; RETURN([op(b), (n+1)-a[1]]); end;
fac_base := n -> fac_base_aux(n, 2); fac_base_aux := proc(n, i) if(0 = n) then RETURN([]); else RETURN([op(fac_base_aux(floor(n/i), i+1)), (n mod i)]); fi; end;
PermRevLexUnrank := n -> `if`((0 = n), [1], fexlist2permlist(fac_base(n)));
cdr := proc(l) if 0 = nops(l) then ([]) else (l[2..nops(l)]); fi; end; # "the tail of the list"
# Same algorithm in different guise, showing how permutations are composed of adjacent transpositions (compare to algorithm PermUnrank3R at A060117):
PermRevLexUnrankAMSDaux := proc(n, r, pp) local s, p, k; p := pp; if(0 = r) then RETURN(p); else s := floor(r/((n-1)!)); for k from n-s to n-1 do p := permul(p, [[k, k+1]]); od; RETURN(PermRevLexUnrankAMSDaux(n-1, r-(s*((n-1)!)), p)); fi; end;
PermRevLexUnrankAMSD := proc(r) local n; n := nops(factorial_base(r)); convert(PermRevLexUnrankAMSDaux(n+1, r, []), 'permlist', 1+(((r+2) mod (r+1))*n)); end;
MATHEMATICA
A055089L[n_] := Reverse@SortBy[DeleteCases[Permutations@Range@n, {__, n}], Reverse]; Flatten@Array[A055089L, 4] (* JungHwan Min, Aug 28 2016 *)
PROG
(MIT/GNU Scheme, with Antti Karttunen's intseq-library):
;; Note that in Scheme, vector indexing is zero-based.
(definec (A055089 n) (vector-ref (A055089permvec-short (A220658 n)) (A220659 n)))
(definec (A055089permvec-short rank) (A055089permvec (+ 1 (A084558 rank)) rank))
(define (A055089permvec size rank) (let ((permvec (make-initialized-vector size 1+))) (let outloop ((rank rank) (i 2)) (cond ((zero? rank) (permvec1inverse-of permvec)) (else (let inloop ((k (- i 1))) (cond ((< k (- i (remainder rank i))) (outloop (floor->exact (/ rank i)) (+ 1 i))) (else (begin (let ((tmp (vector-ref permvec (- k 1)))) (vector-set! permvec (- k 1) (vector-ref permvec k)) (vector-set! permvec k tmp)) (inloop (- k 1)))))))))))
(define (permvec1inverse-of permvec) (make-initialized-vector (vector-length permvec) (lambda (i) (permvec1find-pos-of-i-from (+ 1 i) permvec))))
(define (permvec1find-pos-of-i-from i permvec) (let loop ((k 0)) (cond ((= k (vector-length permvec)) #f) ((= i (vector-ref permvec k)) (+ 1 k)) (else (loop (+ k 1)))))) ;; Antti Karttunen, Dec 18 2012
CROSSREFS
Inversion vectors: A007623, cycle counts: A055090, minimum number of transpositions: A055091, minimum number of adjacent transpositions: A034968, order of each permutation: A055092, number of non-fixed elements: A055093, positions of inverses: A056019, positions after Foata transform: A065181; positions of fixed-point-free involutions: A064640.
Cf. A195663, array of the infinite rows.
This permutation list gives essentially the same information as A030298/A030299, but in a more compact way, by skipping those permutations of A030298 that start with a fixed element.
A220658(n) gives the rank r of the permutation of which the term at a(n) is an element.
A220659(n) gives the zero-based position (from the left) of that a(n) in that permutation of rank r.
A084558(r)+1 gives the size of the finite subsequence (of the r-th infinite, but finitary permutation) which has been included in this list.
KEYWORD
nonn,tabf
AUTHOR
Antti Karttunen, Apr 18 2000
EXTENSIONS
Name changed by Tilman Piesk, Feb 01 2012
STATUS
approved
Positions of permutations of A055089 in the permutation sequence A060117.
+10
19
0, 1, 2, 3, 5, 4, 6, 7, 8, 9, 11, 10, 14, 15, 12, 13, 16, 17, 23, 22, 19, 18, 21, 20, 24, 25, 26, 27, 29, 28, 30, 31, 32, 33, 35, 34, 38, 39, 36, 37, 40, 41, 47, 46, 43, 42, 45, 44, 54, 55, 56, 57, 59, 58, 48, 49, 50, 51, 53, 52, 60, 61, 62, 63, 65, 64, 67, 66, 71, 70, 68, 69
OFFSET
0,3
COMMENTS
Together with the inverse A060119 this can be used to conjugate between "multiplication tables" of A261096 & A261216 (and for example, their main diagonals A261099 & A261219, or between involutions A056019 & A060125, see the Formula section) that have been computed for these two common alternative orderings of permutations. - Antti Karttunen, Sep 28 2016
FORMULA
Other identities. For all n >= 0:
a(A056019(A060119(n))) = A060125(n).
MAPLE
# Procedure PermRank3R is given in A060125 and PermRevLexUnrank in A055089:
A060126(n) = PermRank3R(PermRevLexUnrank(n));
CROSSREFS
Inverse: A060119.
Cf. A060132 (fixed points).
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Mar 02 2001
EXTENSIONS
Edited by Antti Karttunen, Sep 28 2016
STATUS
approved
Self-inverse infinite permutation which shows the position of the inverse of each finite permutation in A060117 (or A060118) in the same sequence; or equally, the cross-indexing between A060117 and A060118.
+10
18
0, 1, 2, 5, 4, 3, 6, 7, 14, 23, 22, 15, 12, 19, 8, 11, 16, 21, 18, 13, 20, 17, 10, 9, 24, 25, 26, 29, 28, 27, 54, 55, 86, 119, 118, 87, 84, 115, 56, 59, 88, 117, 114, 85, 116, 89, 58, 57, 48, 49, 74, 101, 100, 75, 30, 31, 38, 47, 46, 39, 60, 67, 80, 107, 112, 93, 66, 61, 92
OFFSET
0,3
COMMENTS
PermRank3Aux is a slight modification of rank2 algorithm presented in Myrvold-Ruskey article.
MAPLE
with(group); permul := (a, b) -> mulperms(b, a); swap := (p, i, j) -> convert(permul(convert(p, 'disjcyc'), [[i, j]]), 'permlist', nops(p));
PermRank3Aux := proc(n, p, q) if(1 = n) then RETURN(0); else RETURN((n-p[n])*((n-1)!) + PermRank3Aux(n-1, swap(p, n, q[n]), swap(q, n, p[n]))); fi; end;
PermRank3R := p -> PermRank3Aux(nops(p), p, convert(invperm(convert(p, 'disjcyc')), 'permlist', nops(p)));
PermRank3L := p -> PermRank3Aux(nops(p), convert(invperm(convert(p, 'disjcyc')), 'permlist', nops(p)), p);
# a(n) = PermRank3L(PermUnrank3R(n)) or PermRank3R(PermUnrank3L(n)) or PermRank3L(convert(invperm(convert(PermUnrank3L(j), 'disjcyc')), 'permlist', nops(PermUnrank3L(j))))
CROSSREFS
Cf. A261220 (fixed points).
Cf. A056019 (compare the scatter plots).
KEYWORD
nonn,base,look
AUTHOR
Antti Karttunen, Mar 02 2001
STATUS
approved
Positions of permutations of A060117 in reversed colexicographic ordering A055089.
+10
14
0, 1, 2, 3, 5, 4, 6, 7, 8, 9, 11, 10, 14, 15, 12, 13, 16, 17, 21, 20, 23, 22, 19, 18, 24, 25, 26, 27, 29, 28, 30, 31, 32, 33, 35, 34, 38, 39, 36, 37, 40, 41, 45, 44, 47, 46, 43, 42, 54, 55, 56, 57, 59, 58, 48, 49, 50, 51, 53, 52, 60, 61, 62, 63, 65, 64, 67, 66, 70, 71, 69, 68
OFFSET
0,3
COMMENTS
Together with the inverse A060126 this can be used to conjugate between "multiplication tables" of A261096 & A261216 (and for example, their main diagonals A261099 & A261219, or between involutions A056019 & A060125, see the Formula section) that have been computed for these two common alternative orderings of permutations. - Antti Karttunen, Sep 28 2016
FORMULA
As a composition of other permutations:
a(n) = A056019(A060120(n)).
Other identities, for all n >= 0:
a(A060125(A060126(n))) = A056019(n).
MAPLE
# The procedure PermUnrank3R is given in A060117, and PermRevLexRank in A056019:
A060119(n) = PermRevLexRank(PermUnrank3R(n));
CROSSREFS
Inverse: A060126.
Cf. A060132 (fixed points).
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Mar 02 2001
EXTENSIONS
Edited by Antti Karttunen, Sep 27 2016
STATUS
approved
Sums of nonconsecutive factorial numbers.
+10
13
0, 1, 2, 6, 7, 24, 25, 26, 120, 121, 122, 126, 127, 720, 721, 722, 726, 727, 744, 745, 746, 5040, 5041, 5042, 5046, 5047, 5064, 5065, 5066, 5160, 5161, 5162, 5166, 5167, 40320, 40321, 40322, 40326, 40327, 40344, 40345, 40346, 40440, 40441, 40442
OFFSET
1,3
COMMENTS
Zeckendorf (Fibonacci) expansion of n (A003714) reinterpreted as a factorial expansion.
Also positions in A055089, A060117 and A060118 of the permutations that are composed of disjoint adjacent transpositions only. (That these positions are same can be seen by comparing algorithms PermRevLexUnrankAMSD, PermUnrank3R, PermUnrank3L in the respective sequences). Thus also positions of the fixed terms in A065181-A065184. See comment at A065163.
Written as disjoint cycles the permutations are: (), (1 2), (2 3), (3 4), (1 2)(3 4), (4 5), (1 2)(4 5), (2 3)(4 5), etc. Apart from the first one (the identity), these are the only kind of permutations used in campanology when moving from one "change" to next.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Arthur T. White, Ringing the Changes, Math. Proc. Camb. Phil. Soc., September 1983, Vol. 94, part 2, pp. 203-215.
FORMULA
a(n) = PermRevLexRank(CampanoPerm(n))
a(A001611(n)) = (n-1)! for n > 2. - David A. Corneth, Jun 25 2017
EXAMPLE
Zeckendorf Expansions of first few natural numbers and the corresponding values when interpreted as factorial expansions: 0 = 0 = 0, 1 = 1 = 1, 2 = 10 = 2, 3 = 100 = 6, 4 = 101 = 7, 5 = 1000 = 24, 6 = 1001 = 25, 7 = 1010 = 26, 8 = 10000 = 120, etc.,
MAPLE
CampanoPerm := proc(n) local z, p, i; p := []; z := fibbinary(n); i := 1; while(z > 0) do if(1 = (z mod 2)) then p := permul(p, [[i, i+1]]); fi; i := i+1; z := floor(z/2); od; RETURN(convert(p, 'permlist', i)); end;
MATHEMATICA
With[{b = MixedRadix[Range[12, 2, -1]]}, FromDigits[#, b] & /@ Select[Tuples[{0, 1}, 8], SequenceCount[#, {1, 1}] == 0 &]] (* Michael De Vlieger, Jun 26 2017 *)
PROG
(PARI) fill(lim, k, val)=if(k>#f, return); my(t=val+f[k]); if(t<=lim, listput(v, t); fill(lim, k+2, t)); fill(lim, k+1, val)
list(lim)=my(k, t=1); local(f=List(), v=List([0])); while((t*=k++)<=lim, listput(f, t)); f=Vecrev(f); fill(lim, 1, 0); Set(v) \\ Charles R Greathouse IV, Jun 25 2017
(PARI) first(n) = my(res = [0, 1], k = 1, t = 1, p = 1); while(#res < n, k++; t++; p *= t; res = concat(res, vector(fibonacci(k), i, res[i]+p))); vector(n, i, res[i]) \\ David A. Corneth, Jun 26 2017
CROSSREFS
Subset of A059590. Cf. also A001611, A064640.
For PermRevLexRank, see A056019, for fibbinary see A048679 and A003714.
KEYWORD
nonn,easy,nice
AUTHOR
Antti Karttunen, Mar 01 2001
STATUS
approved
Positions of permutations of A060118 in the canonical permutation list A055089.
+10
12
0, 1, 2, 4, 5, 3, 6, 7, 12, 18, 19, 13, 14, 20, 8, 10, 16, 22, 21, 15, 23, 17, 11, 9, 24, 25, 26, 28, 29, 27, 48, 49, 72, 96, 97, 73, 74, 98, 50, 52, 76, 100, 99, 75, 101, 77, 53, 51, 54, 55, 78, 102, 103, 79, 30, 31, 36, 42, 43, 37, 60, 66, 84, 108, 114, 90, 67, 61, 91
OFFSET
0,3
FORMULA
a(n) = PermRevLexRank(PermUnrank3L(n))
CROSSREFS
PermRevLexRank given in A056019. A060120[n] = A056019[A060119[n]] for all n.
Inverse permutation: A060127.
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 02 2001
STATUS
approved
Permutation of nonnegative integers produced when the finite permutations listed by A055089 are subjected to inverse of Foata's transformation. Inverse of A065182.
+10
8
0, 1, 2, 5, 3, 4, 6, 7, 14, 23, 17, 20, 8, 11, 12, 22, 13, 21, 9, 10, 16, 18, 15, 19, 24, 25, 26, 29, 27, 28, 54, 55, 86, 119, 95, 110, 62, 71, 78, 116, 79, 113, 65, 68, 92, 102, 89, 103, 30, 31, 38, 47, 41, 44, 48, 49, 84, 118, 94, 108, 50, 53, 80, 117, 83, 109, 51, 52
OFFSET
0,3
COMMENTS
Here we use the inverse of the left-right maxima variant of Foata's transformation, which works by rotating each cycle largest element first and then sorts the cycles to ascending order, according to that first (and largest) element of each.
REFERENCES
I.M. Gessel and R. P. Stanley, Algebraic Enumeration, chapter 21 in Handbook of Combinatorics, Vol. 2, edited by R.L.Graham et al., The MIT Press, Mass, 1995, page 1045.
LINKS
MAPLE
[seq(PermRevLexRank(FoataInv(PermRevLexUnrank(j))), j=0..119)];
with(group); FoataInv := p -> map(op, sort([op(map(RotCycleLargestFirst, convert(p, `disjcyc`))), op(FixedCycles(p))], sortbyfirst));
sortbyfirst := (a, b) -> `if`((a[1] < b[1]), true, false);
FindLargest := proc(a) local i, m; m := 0; for i from 1 to nops(a) do if(0 = m) then m := i; else if(a[i] > a[m]) then m := i; fi; fi; od; RETURN(m); end;
RotCycleLargestFirst := proc(c) local x; x := FindLargest(c); if(x <= 1) then RETURN(c); else RETURN([op(c[x..nops(c)]), op(c[1..(x-1)])]); fi; end;
FixedCycles := proc(p) local a, i; a := []; for i from 1 to nops(p) do if(p[i] = i) then a := [op(a), [i]]; fi; od; RETURN(a); end;
CROSSREFS
A065161-A065163 give cycle counts and max lengths. Cf. also A065183, A065184 and A055089 and A056019 for the requisite Maple procedures.
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 19 2001
STATUS
approved
A(i,j) = rank (in A055089) of the composition of the i-th and the j-th permutation in table A055089, which lists all finite permutations in reversed colexicographic ordering.
+10
8
0, 1, 1, 2, 0, 2, 3, 4, 3, 3, 4, 5, 0, 2, 4, 5, 2, 1, 5, 5, 5, 6, 3, 5, 4, 1, 4, 6, 7, 7, 4, 0, 0, 3, 7, 7, 8, 6, 12, 1, 3, 2, 8, 6, 8, 9, 10, 13, 13, 2, 1, 9, 10, 9, 9, 10, 11, 14, 12, 18, 0, 10, 11, 6, 8, 10, 11, 8, 15, 16, 19, 19, 11, 8, 7, 11, 11, 11, 12, 9, 16, 17, 20, 18, 0, 9, 11, 10, 7, 10, 12, 13, 18, 17, 14, 21, 22, 1, 1, 10, 6, 6, 9, 13, 13, 14, 19, 6, 15, 22, 23, 2, 0, 14, 7, 9, 8, 14, 12, 14
OFFSET
0,4
COMMENTS
The square array A(row>=0, col>=0) is read by downwards antidiagonals as: A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), A(0,3), A(1,2), A(2,1), A(3,0), ...
A(i,j) gives the rank (in ordering used by table A055089) of the permutation which is obtained by composing permutations p and q listed as the i-th and the j-th permutation in irregular table A055089 (note that the identity permutation is the 0th). Here the convention is that "permutations act of the left", thus, if p1 and p2 are permutations, then the product of p1 and p2 (p1 * p2) is defined such that (p1 * p2)(i) = p1(p2(i)) for i=1...
Each row and column is a permutation of A001477, because this is the Cayley table ("multiplication table") of an infinite enumerable group, namely, that subgroup of the infinite symmetric group (S_inf) which consists of permutations moving only finite number of elements.
FORMULA
By conjugating with related permutations and arrays:
A(i,j) = A056019(A261097(A056019(i),A056019(j))).
A(i,j) = A060119(A261216(A060126(i),A060126(j))).
A(i,j) = A060120(A261217(A060127(i),A060127(j))).
EXAMPLE
The top left corner of the array:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...
1, 0, 4, 5, 2, 3, 7, 6, 10, 11, 8, 9, 18, ...
2, 3, 0, 1, 5, 4, 12, 13, 14, 15, 16, 17, 6, ...
3, 2, 5, 4, 0, 1, 13, 12, 16, 17, 14, 15, 19, ...
4, 5, 1, 0, 3, 2, 18, 19, 20, 21, 22, 23, 7, ...
5, 4, 3, 2, 1, 0, 19, 18, 22, 23, 20, 21, 13, ...
6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 14, ...
7, 6, 10, 11, 8, 9, 1, 0, 4, 5, 2, 3, 20, ...
8, 9, 6, 7, 11, 10, 14, 15, 12, 13, 17, 16, 0, ...
9, 8, 11, 10, 6, 7, 15, 14, 17, 16, 12, 13, 21, ...
10, 11, 7, 6, 9, 8, 20, 21, 18, 19, 23, 22, 1, ...
11, 10, 9, 8, 7, 6, 21, 20, 23, 22, 18, 19, 15, ...
12, 13, 14, 15, 16, 17, 2, 3, 0, 1, 5, 4, 8, ...
...
For A(1,2) (row=1, column=2, both starting from zero), we take as permutation p the permutation which has rank=1 in the ordering used by A055089, which is a simple transposition (1 2), which we can extend with fixed terms as far as we wish (e.g., like {2,1,3,4,5,...}), and as permutation q we take the permutation which has rank=2 (in the same list), which is {1,3,2}. We compose these from the left, so that the latter one, q, acts first, thus c(i) = p(q(i)), and the result is permutation {2,3,1}, which is listed as the 4th one in A055089, thus A(1,2) = 4.
For A(2,1) we compose those two permutations in opposite order, as d(i) = q(p(i)), which gives permutation {3,1,2} which is listed as the 3rd one in A055089, thus A(2,1) = 3.
CROSSREFS
Transpose: A261097.
Row 0 & Column 0: A001477 (identity permutation).
Row 1: A261098.
Column 1: A004442.
Main diagonal: A261099.
Cf. tables A055089, A195663.
Cf. also A261216, A261217 (similar arrays, but using different orderings of permutations).
Permutations used in conjugation-formulas: A056019, A060119, A060120, A060126, A060127.
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Aug 26 2015
STATUS
approved
Transpose of square array A261096.
+10
6
0, 1, 1, 2, 0, 2, 3, 3, 4, 3, 4, 2, 0, 5, 4, 5, 5, 5, 1, 2, 5, 6, 4, 1, 4, 5, 3, 6, 7, 7, 3, 0, 0, 4, 7, 7, 8, 6, 8, 2, 3, 1, 12, 6, 8, 9, 9, 10, 9, 1, 2, 13, 13, 10, 9, 10, 8, 6, 11, 10, 0, 18, 12, 14, 11, 10, 11, 11, 11, 7, 8, 11, 19, 19, 16, 15, 8, 11, 12, 10, 7, 10, 11, 9, 0, 18, 20, 17, 16, 9, 12, 13, 13, 9, 6, 6, 10, 1, 1, 22, 21, 14, 17, 18, 13, 14, 12, 14, 8, 9, 7, 14, 0, 2, 23, 22, 15, 6, 19, 14
OFFSET
0,4
COMMENTS
Each row and column is a permutation of A001477. See the comments at A261096.
FORMULA
By conjugating with related permutations and arrays:
A(i,j) = A056019(A261096(A056019(i),A056019(j))).
A(i,j) = A060119(A261217(A060126(i),A060126(j))).
A(i,j) = A060120(A261216(A060127(i),A060127(j))).
EXAMPLE
The top left corner of the array:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...
1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, ...
2, 4, 0, 5, 1, 3, 8, 10, 6, 11, 7, 9, 14, ...
3, 5, 1, 4, 0, 2, 9, 11, 7, 10, 6, 8, 15, ...
4, 2, 5, 0, 3, 1, 10, 8, 11, 6, 9, 7, 16, ...
5, 3, 4, 1, 2, 0, 11, 9, 10, 7, 8, 6, 17, ...
6, 7, 12, 13, 18, 19, 0, 1, 14, 15, 20, 21, 2, ...
7, 6, 13, 12, 19, 18, 1, 0, 15, 14, 21, 20, 3, ...
8, 10, 14, 16, 20, 22, 2, 4, 12, 17, 18, 23, 0, ...
9, 11, 15, 17, 21, 23, 3, 5, 13, 16, 19, 22, 1, ...
10, 8, 16, 14, 22, 20, 4, 2, 17, 12, 23, 18, 5, ...
11, 9, 17, 15, 23, 21, 5, 3, 16, 13, 22, 19, 4, ...
12, 18, 6, 19, 7, 13, 14, 20, 0, 21, 1, 15, 8, ...
...
CROSSREFS
Transpose: A261096.
Row 0 & Column 0: A001477 (identity permutation).
Row 1: A004442.
Column 1: A261098.
Main diagonal: A261099.
Cf. also A055089, A195663.
Cf. also A261216, A261217 (similar arrays, but using different orderings of permutations).
Permutations used in conjugation-formulas: A056019, A060119, A060120, A060126, A060127.
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Aug 26 2015
STATUS
approved

Search completed in 0.013 seconds