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-10 of 11 results. Next

A064636 Number of derangements up to cyclic rotations; permutation siteswap necklaces, with no fixed points (no "zero-throws", i.e., empty hands, if we use the mapping Perm2SiteSwap1 of A060495 and A060498).

Original entry on oeis.org

0, 0, 1, 2, 5, 12, 55, 270, 1893, 14864, 133749, 1334970, 14687195, 176214852, 2290820923, 32071104006, 481066907653, 7697064251760, 130850098582189, 2355301661033970, 44750731672347273, 895014631193654828, 18795307257304746591, 413496759611120779902, 9510425471105377569963, 228250211305338670543432
Offset: 0

Views

Author

Antti Karttunen, Oct 02 2001

Keywords

Comments

This sequence counts derangements (enumerated by A000166) up to the same automorphism as permutations (enumerated by A000142) are subjected to in A061417.

Programs

  • Maple
    with(numtheory); A064636 := proc(n) local d,k,s; s := 0; for d in divisors(n) do s := s + (1/n) * phi(n/d) * ( (((n/d)^d)*A000166(d)) + add((((n/d)^(d-k)) * (((n/d)-1)^k) * (A000166(d-k)*binomial(d,k))),k=1..d)); od; RETURN(s); end;
  • Mathematica
    Unprotect[Power]; 0^0 = 1; a[n_] := (1/n) DivisorSum[n, EulerPhi[n/#]*Sum[ (n/#)^(# - k)*(n/# - 1)^k*#!*Gamma[# - k + 1, -1]/(E*k!*(# - k)!), {k, 0, #}]&] // FunctionExpand; a[0] = 0; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Mar 06 2016 *)

Formula

a(n) = Sum_{d|n} (1/n) * Phi(n/d) * Sum_{k=0..d} [ ((n/d)^(d-k)) * (((n/d)-1)^k) * A008290(d, k) ]. (Note: this abbreviated formula supposes that 0^0 = 1. For a practical implementation, see the Maple procedure below.)

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.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 22 2001

Keywords

Comments

From Antti Karttunen, Aug 11-24 2016: (Start)
a(n) gives the number of occupied "digit slopes" in the factorial base representation of n, or more formally, the number of distinct elements in a multiset [(i_x - d_x) | where d_x ranges over each nonzero digit present in factorial base representation of n and i_x is that digit's position from the right]. Here one-based indexing is used, thus the least significant digit is in position 1. Each value {digit's position} - {digit's value} determines on which slope that particular nonzero digit is. The nonzero digits for which (position - digit) = 0, are said to be on the "maximal slope" (see A260736), those with value 1 on "sub-maximal", etc.
The number of occupied digit slopes translates directly to the number of drops in the n-th permutation as given in the list A060117 because only the largest (and thus leftmost) of all nonzero digits on any particular slope adds a (single) drop to the permutation, when constructed by the unranking algorithm employed in A060117.
The original definition of this sequence is (essentially):
a(n) = the average of digits (where "digits" may eventually obtain also any values > 9) in each siteswap pattern A060498(n) constructed from each permutation in list A060117, which is equal to number of balls used in that pattern.
The equivalence of the old and the new definitions is seen from the following (as kindly pointed by Olivier Gérard in personal mail): For any permutation p of [1..n], Sum(i=1..n) p(i)-i = 0 (whether taken modulo n or not), thus Sum(i=1..n) (p(i)-i modulo n) = Sum(i={set of nondrops}) (p(i)-i) + Sum(i={set of drops}) (n + (p(i)-i)) = 0 + n * #{set of drops}, where drops is the set of those i where p[i] < i and nondrops are those i for which p[i] >= 1.
Involution A225901 maps this metric to another metric A275806 which gives the number of distinct nonzero digits in factorial base representation of n. See also A275811.
A007489 (repunits in this context) gives the positions where a(n) = A084558(n) (the length of factorial base representation of n). These are also the positions of records.
(End)

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.
		

Crossrefs

Cf. A007489 (positions of records, the first occurrence of each n).
Cf. A276001, A276002, A276003 (positions where a(n) obtains values 1, 2, 3).

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:
a(n) = A001221(A275734(n)).
a(n) = A275806(A225901(n)).
a(n) = A000120(A276010(n)).
Other identities and observations. For all n >= 0:
a(n) = A275946(n) + A275947(n).
a(n) = A060500(A060125(n)).
a(n) = A060128(n) + A276004(n).
a(n) = A060129(n) - A060500(n).
a(n) = A084558(n) - A275849(n) = 1 + A084558(n) - A060501(n).
a(A007489(n)) = n. [Particularly, A007489(n) gives the position of the first occurrence of each n.]
A060128(n) <= a(n) <= A060129(n).
a(n!) = 1.
a(A033312(n)) = 1 for all n > 1.
a(A059590(n)) = A000120(n).
a(A060112(n)) = A007895(n).
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

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

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

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

Original entry on oeis.org

0, 11, 210, 111, 102, 222, 3100, 3131, 2110, 1111, 1102, 2132, 2020, 1021, 3320, 3221, 2222, 1322, 1003, 2033, 1313, 2213, 3203, 3333, 41000, 41041, 41410, 41311, 41302, 41442, 31100, 31141, 21110, 11111, 11102, 21142, 21020, 11021, 31420
Offset: 0

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 A060495, A006694.
In A060498 the digits are also "inverted", giving valid siteswap juggling patterns.

Programs

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

Formula

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

A071160 Łukasiewicz words that are also valid asynchronic siteswap juggling patterns.

Original entry on oeis.org

0, 1, 20, 11, 300, 201, 120, 111, 4000, 3001, 2020, 2011, 1300, 1201, 1120, 1111, 50000, 40001, 30020, 30011, 20300, 20201, 20120, 20111, 14000, 13001, 12020, 12011, 11300, 11201, 11120, 11111, 600000, 500001, 400020, 400011, 300300
Offset: 0

Author

Antti Karttunen, May 14 2002

Keywords

Comments

Note: this finite decimal representation works only up to the 511th term, as the 512th such word is already (10,0,0,0,0,0,0,0,0,0). The sequence A071161 shows the initial portion of this sequence sorted.

Crossrefs

Formula

Construction: starting from the most significant (the leftmost) bit, replace each 1-bit in the binary expansion of n with the distance to the next 1-bit to the right, allowing a cyclic wrap-over from the least-significant 1-bit to the most significant 1-bit. I.e. from 22 = 10110 in binary we get 20120, the 22nd term of this sequence.
a(n) = A071161(A054429(n)).

A276001 Numbers n for which A060502(n) <= 1; numbers with at most one distinct slope in their factorial representation.

Original entry on oeis.org

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

Author

Antti Karttunen, Aug 16 2016

Keywords

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.
		

Crossrefs

Cf. A000142, A033312, A051683 (subsequences).

A276002 Numbers n for which A060502(n) = 2; numbers with exactly two occupied slopes in their factorial representation.

Original entry on oeis.org

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

Author

Antti Karttunen, Aug 16 2016

Keywords

Comments

Also numbers n such that A060498(n) is a two-ball juggling pattern.

Crossrefs

Formula

Other identities. For all n >= 1:
A060130(a(n)) >= 2.

A276003 Numbers n for which A060502(n) = 3; numbers with exactly three occupied slopes in their factorial representation.

Original entry on oeis.org

9, 27, 31, 32, 34, 35, 37, 39, 40, 41, 44, 45, 51, 57, 61, 63, 64, 65, 68, 69, 79, 81, 82, 83, 104, 105, 123, 127, 128, 130, 131, 133, 135, 136, 137, 140, 141, 145, 146, 148, 149, 150, 156, 158, 162, 163, 166, 167, 169, 170, 172, 173, 175, 176, 178, 179, 180, 182, 186, 187, 190, 191, 193, 195, 196, 197, 198, 200, 205, 207, 208, 209, 210, 211, 212
Offset: 1

Author

Antti Karttunen, Aug 16 2016

Keywords

Comments

Also numbers n such that A060498(n) is a three-ball juggling pattern.

Examples

			27 ("1011" in factorial base) is included as there are three distinct values attained by the difference digit_position - digit_value when computed for its nonzero digits: 4-1 = 3, 2-1 = 1 and 1-1 = 0.
51 ("2011" in factorial base) is included as there are three distinct values attained by the difference digit_position - digit_value when computed for its nonzero digits: 4-2 = 2, 2-1 = 1 and 1-1 = 0.
57 ("2111" in factorial base) is included as there are three distinct values attained by the difference digit_position - digit_value when computed for its nonzero digits: 4-2 = 3-1 = 2, 2-1 = 1 and 1-1 = 0.
		

Crossrefs

Formula

Other identities. For all n >= 1:
A060130(a(n)) >= 3.

A060499 Each permutation in the list A060118 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, 111, 201, 222, 1300, 1313, 1120, 1111, 1201, 1223, 2020, 2011, 2330, 2312, 2222, 2231, 3001, 3023, 3131, 3122, 3302, 3333, 14000, 14014, 14140, 14113, 14203, 14244, 11300, 11314, 11120, 11111, 11201, 11224, 12020, 12011, 12340
Offset: 0

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

References

Formula

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

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

Author

Antti Karttunen, Aug 26 2015

Keywords

Crossrefs

Subsequence: A014417.

Programs

Formula

a(n) = A007623(A261220(n)).
Showing 1-10 of 11 results. Next