A060502 a(n) = number of occupied digit slopes in the factorial base representation of n (see comments for the definition); number of drops in the n-th permutation of list A060117.
0, 1, 1, 2, 1, 1, 1, 2, 2, 3, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 3, 2, 2, 2, 3, 3, 4, 3, 3, 2, 3, 2, 3, 3, 3, 2, 2, 3, 3, 2, 2, 1, 2, 2, 3, 2, 2, 1, 2, 2, 3, 2, 2, 2, 3, 2, 3, 3, 3, 2, 2, 3, 3, 2, 2, 1, 2, 1, 2, 2, 2, 2, 3, 2, 3, 3, 3, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1
Offset: 0
Examples
For n=23 ("321" in factorial base representation, A007623), all the digits are maximal for their positions (they occur on the "maximal slope"), thus there is only one distinct digit slope present and a(23)=1. Also, for the 23rd permutation in the ordering A060117, [2341], there is just one drop, as p[4] = 1 < 4. For n=29 ("1021"), there are three nonzero digits, where both 2 and the rightmost 1 are on the maximal slope, while the most significant 1 is on the "sub-sub-sub-maximal", thus there are two occupied slopes in total, and a(29) = 2. In the 29th permutation of A060117, [23154], there are two drops as p[3] = 1 < 3 and p[5] = 4 < 5. For n=37 ("1201"), there are three nonzero digits, where the rightmost 1 is on the maximal slope, 2 is on the submaximal, and the most significant 1 is on the "sub-sub-sub-maximal", thus there are three occupied slopes in total, and a(37) = 3. In the 37th permutation of A060117, [51324], there are three drops at indices 2, 4 and 5.
Links
Crossrefs
Cf. A000120, A001221, A007489, A007623, A033312, A060117, A060118, A060130, A060498, A225901, A275734, A275806.
Cf. A007489 (positions of records, the first occurrence of each n).
Programs
-
Maple
# The following program follows the original 2001 interpretation of this sequence: A060502 := n -> avg(Perm2SiteSwap3(PermUnrank3R(n))); with(group); permul := (a, b) -> mulperms(b, a); # factorial_base(n) gives the digits of A007623(n) as a list, uncorrupted even when there are digits > 9: 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; # 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; Perm2SiteSwap3 := 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 if(0 = ((ip[i]-i) mod n)) then a := [op(a),0]; else a := [op(a), n-((ip[i]-i) mod n)]; fi; od; RETURN(a); end; avg := a -> (convert(a, `+`)/nops(a));
Formula
From Antti Karttunen, Aug 11-21 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} ((p[i]-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) = Sum_{i=1..s} [p[i]
a(n) = 1/s * Sum_{i=1..s} ((i-p[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].
Following formulas do not need intermediate construction of permutation lists:
Other identities and observations. For all n >= 0:
a(n!) = 1.
a(A033312(n)) = 1 for all n > 1.
a(n) = a(A153880(n)) = a(A255411(n)). [The shift-operations do not change the number of distinct slopes.]
a(A275804(n)) = A060130(A275804(n)). [A275804 gives all the positions where this coincides with A060130.]
(End)
Extensions
Entry revised, with a new interpretation and formulas. Maple-code cleaned up. - Antti Karttunen, Aug 11 2016
Another new interpretation added and the original definition moved to the comments - Antti Karttunen, Aug 24 2016
A276001 Numbers n for which A060502(n) <= 1; numbers with at most one distinct slope in their factorial representation.
0, 1, 2, 4, 5, 6, 12, 14, 18, 19, 22, 23, 24, 48, 54, 72, 74, 84, 86, 96, 97, 100, 101, 114, 115, 118, 119, 120, 240, 264, 360, 366, 408, 414, 480, 482, 492, 494, 552, 554, 564, 566, 600, 601, 604, 605, 618, 619, 622, 623, 696, 697, 700, 701, 714, 715, 718, 719, 720, 1440, 1560, 2160, 2184, 2400, 2424, 2880, 2886, 2928, 2934, 3240, 3246, 3288, 3294
Offset: 0
Comments
Indexing starts from zero, because a(0)=0 is a special case in this sequence. To get those n for which A060502(n) = 1, start listing terms from a(1) = 1 onward.
From n=1 onward numbers in whose factorial base representation (A007623) the difference i_x - d_x is the same for all nonzero digits d_x present. Here i_x is the position of digit d_x from the least significant end.
From n=1 onward also n such that A060498(n) is a one-ball juggling pattern.
Examples
4 ("20" in factorial base) is present, because all nonzero digits are on the same slope as there is only one nonzero digit. 14 ("210" in factorial base) is present, because all nonzero digits are on the same slope, as 3-2 = 2-1. 19 ("301" in factorial base) is present, because all nonzero digits are on the same slope, as 3-3 = 1-1. 21 ("311" in factorial base) is NOT present, because not all of its nonzero digits are on the same slope, as 3-3 <> 2-1.
A276002 Numbers n for which A060502(n) = 2; numbers with exactly two occupied slopes in their factorial representation.
3, 7, 8, 10, 11, 13, 15, 16, 17, 20, 21, 25, 26, 28, 29, 30, 36, 38, 42, 43, 46, 47, 49, 50, 52, 53, 55, 56, 58, 59, 60, 62, 66, 67, 70, 71, 73, 75, 76, 77, 78, 80, 85, 87, 88, 89, 90, 91, 92, 93, 94, 95, 98, 99, 102, 103, 106, 107, 108, 109, 110, 111, 112, 113, 116, 117, 121, 122, 124, 125, 126, 132, 134, 138, 139, 142, 143, 144, 168, 174, 192, 194
Offset: 1
Comments
Also numbers n such that A060498(n) is a two-ball juggling pattern.
Links
Formula
Other identities. For all n >= 1:
A060130(a(n)) >= 2.
Comments