login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 4
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,6

LINKS

Antti Karttunen, Table of n, a(n) for n = 0..40320

Index entries for sequences related to factorial base representation

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]<i]. [And this is equal to the number of drops in that permutation p, see comments in 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)

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));

PROG

(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)))))))

CROSSREFS

Cf. A060125, A060129, A060501, A060502, A275849, A275851.

Sequence in context: A219157 A080215 A266871 * A187284 A160198 A207709

Adjacent sequences:  A060497 A060498 A060499 * A060501 A060502 A060503

KEYWORD

nonn

AUTHOR

Antti Karttunen, Mar 22 2001

EXTENSIONS

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

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 21 19:58 EDT 2019. Contains 328315 sequences. (Running on oeis4.)