cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-5 of 5 results.

A060500 a(n) = number of drops in the n-th permutation of list A060118; the average of digits (where "digits" may eventually obtain also any values > 9) in each siteswap pattern A060496(n).

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 3, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 3, 1, 2, 1, 1, 1, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 1, 2, 2, 2, 2, 3, 2, 3, 2
Offset: 0

Views

Author

Antti Karttunen, Mar 22 2001

Keywords

Crossrefs

Programs

  • Maple
    A060500 := avg(Perm2SiteSwap1(PermUnrank3R(n)));
    # PermUnrank3R(r) gives the permutation with rank r in list A060117:
    PermUnrank3R := proc(r) local n; n := nops(factorial_base(r)); convert(PermUnrank3Raux(n+1, r, []), 'permlist', 1+(((r+2) mod (r+1))*n)); end;
    PermUnrank3Raux := proc(n, r, p) local s; if(0 = r) then RETURN(p); else s := floor(r/((n-1)!)); RETURN(PermUnrank3Raux(n-1, r-(s*((n-1)!)), permul(p, [[n, n-s]]))); fi; end;
    Perm2SiteSwap1 := proc(p) local ip, n, i, a; n := nops(p); ip := convert(invperm(convert(p, 'disjcyc')), 'permlist', n); a := []; for i from 1 to n do a := [op(a), ((ip[i]-i) mod n)]; od; RETURN(a); end;
    avg := a -> (convert(a,`+`)/nops(a));
  • Scheme
    (define (A060500 n) (let ((s (+ 1 (A084558 n))) (p (A060118permvec-short n))) (let loop ((d 0) (i 1)) (if (> i s) d (loop (+ d (if (< (vector-ref p (- i 1)) i) 1 0)) (+ 1 i))))))
    (define (A060118permvec-short rank) (permute-A060118 (make-initialized-vector (+ 1 (A084558 rank)) 1+) (+ 1 (A084558 rank)) rank))
    (define (permute-A060118 elems size permrank) (let ((p (vector-head elems size))) (let unrankA060118 ((r permrank) (i 1)) (cond ((zero? r) p) (else (let* ((j (1+ i)) (m (modulo r j))) (cond ((not (zero? m)) (let ((org-i (vector-ref p i))) (vector-set! p i (vector-ref p (- i m))) (vector-set! p (- i m) org-i)))) (unrankA060118 (/ (- r m) j) j)))))))

Formula

From Antti Karttunen, Aug 18 2016: (Start)
The following formula reflects the original definition of computing the average, with a few unnecessary steps eliminated:
a(n) = 1/s * Sum_{i=1..s} ((i-p[i]) modulo s), where p is the permutation of rank n as ordered in the list A060117, and s is its size (the number of its elements) computed as s = 1+A084558(n).
a(n) = 1/s * Sum_{i=1..s} ((p[i]-i) modulo s). [If inverse permutations from list A060118 are used, then we just flip the order of difference that is used in the first formula].
a(n) = Sum_{i=1..s} [p[i]A060502 for the proof].
a(n) = A060502(A060125(n)).
a(n) = A060129(n) - A060502(n).
a(n) = A060501(n) - A275851(n) = 1 + A275849(n) - A275851(n).
(End)

Extensions

Maple code collected together, alternative definition and new formulas added by Antti Karttunen, Aug 24 2016

A060498 Each permutation in the list A060117 converted to Site Swap notation, with digits reversed and inverted. "Zero throws" (fixed elements) indicated with 0's.

Original entry on oeis.org

0, 11, 120, 222, 201, 111, 1300, 1313, 2330, 3333, 3302, 2312, 2020, 3023, 1120, 1223, 2222, 3122, 3001, 2011, 3131, 2231, 1201, 1111, 14000, 14014, 14140, 14244, 14203, 14113, 24400, 24414, 34440, 44444, 44403, 34413, 34030, 44034, 24130
Offset: 0

Views

Author

Antti Karttunen, Mar 22 2001

Keywords

Comments

This sequence is not well-defined for n >= 3628800 because the Site Swap notation can contain values exceeding 9, for example, the Site Swap notation for a(3628800) is [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 10]. - Sean A. Irvine, Nov 25 2022

Crossrefs

Cf. A060495, A060496, A060499. Average of digits gives number of balls: A060502.

Programs

  • Maple
    SiteSwap3ToDec := proc(s) local i,z,n; n := nops(s); z := 0; for i from n by -1 to 1 do z := 10*z; if(s[i] > 0) then z := z + (n-s[i]); fi; od; RETURN(z); end;

Formula

a(n) = SiteSwap3ToDec(Perm2SiteSwap1(PermUnrank3R(n))).

A060495 Each permutation in the list A060117 converted to Site Swap notation, with "zero throws" (fixed elements) replaced with n, the length of siteswap.

Original entry on oeis.org

1, 11, 312, 111, 231, 222, 4413, 1313, 4112, 1111, 2411, 2312, 4242, 1241, 4233, 1223, 2222, 2231, 3441, 3342, 3131, 3122, 3423, 3333, 55514, 14514, 51414, 11314, 25314, 24414, 55113, 14113, 51112, 11111, 25111, 24112, 52512, 12511, 52413
Offset: 0

Views

Author

Antti Karttunen, Mar 21 2001

Keywords

Comments

This sequence is not well-defined for n >= 3628800 because the Site Swap notation can contain values exceeding 9, for example, the Site Swap notation for a(3628800) is [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 10]. - Sean A. Irvine, Nov 25 2022

Crossrefs

Cf. factorial base representation A007623 and A060496, A006694.
See also A060498, A060499, A061417. Average of digits gives number of balls: A060501.

Programs

  • Maple
    Perm2SiteSwap1 := proc(p) local ip,n,i,a; n := nops(p); ip := convert(invperm(convert(p,'disjcyc')),'permlist',n); a := []; for i from 1 to n do a := [op(a),((ip[i]-i) mod n)]; od; RETURN(a); end;
    SiteSwap1ToDec := proc(s) local i,z,n; n := nops(s); z := 0; for i from 1 to n do z := 10*z; if(0 = s[i]) then z := z+n; else z := z+s[i]; fi; od; RETURN(z); end;

Formula

a(n) = SiteSwap1ToDec(Perm2SiteSwap1(PermUnrank3R(n))).

A064039 Reversed inversion vectors for the permutations of A060117, presented as pseudo-decimal numbers.

Original entry on oeis.org

0, 1, 10, 11, 21, 20, 100, 101, 110, 111, 121, 120, 210, 211, 200, 201, 220, 221, 311, 310, 321, 320, 301, 300, 1000, 1001, 1010, 1011, 1021, 1020, 1100, 1101, 1110, 1111, 1121, 1120, 1210, 1211, 1200, 1201, 1220, 1221, 1311, 1310, 1321, 1320, 1301, 1300
Offset: 1

Views

Author

Antti Karttunen, Aug 23 2001

Keywords

Comments

If one uses the ordering of A055089 instead of A060117 (procedure PermRevLexUnrank instead of PermUnrank3R) one gets A007623 (Integers written in factorial base) which is a permutation of this sequence.

Crossrefs

SiteSwap2ToDec procedure given in A060496 and PermUnrank3R in A060117.

Programs

  • Maple
    [seq(SiteSwap2ToDec(Perm2InversionVector(PermUnrank3R(j))),j=0..119)];
    Perm2InversionVector := proc(p) local n,i,j,a,c; n := nops(p); a := []; for i from 2 to n do c := 0; for j from 1 to i-1 do if(p[j] > p[i] then c := c+1; fi; od; a := [op(a),c]; od; RETURN(a); end;

A260743 Sequence A261220 shown in factorial base: a(n) = A007623(A261220(n)).

Original entry on oeis.org

0, 1, 10, 20, 100, 101, 200, 220, 300, 310, 1000, 1001, 1010, 1020, 2000, 2001, 2200, 2300, 3000, 3020, 3100, 3300, 4000, 4010, 4100, 4200, 10000, 10001, 10010, 10020, 10100, 10101, 10200, 10220, 10300, 10310, 20000, 20001, 20010, 20020, 22000, 22001, 23000, 23020, 24000, 24010, 30000, 30001, 30200, 30300, 31000, 31001, 33000, 33300, 34000, 34200, 40000, 40020, 40100, 40300, 41000, 41020, 42000, 42300
Offset: 0

Views

Author

Antti Karttunen, Aug 26 2015

Keywords

Crossrefs

Subsequence: A014417.

Programs

Formula

a(n) = A007623(A261220(n)).
Showing 1-5 of 5 results.