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 34 results. Next

A191280 a(0)=1; for n>0, p2(n)+Sum(binomial(2*k,k)*p2(n-k)/2,k=1..n-1) where p2 = A002995, the number of unlabeled planar trees on n nodes.

Original entry on oeis.org

1, 1, 2, 6, 18, 60, 210, 754, 2766, 10280, 38568, 145770, 554162, 2116568, 8115660, 31220672, 120442860, 465775226, 1805074882, 7008550224, 27257398714, 106166467074, 414068416752, 1616899329454, 6320798698322, 24734167234028, 96877398455260, 379765373701964, 1489867265555382, 5849164981941642, 22979031257945948
Offset: 0

Views

Author

N. J. A. Sloane, May 29 2011

Keywords

Crossrefs

Programs

  • Maple
    C:=n->binomial(2*n,n)/(n+1); # A000108
    ch:=n->if n mod 2 = 1 then 1 else 0; fi;
    p2:=n->(1/(2*n)*add(numtheory[phi](n/d)*binomial(2*d,d), d in divisors(n))) - C(n)/2 +(1/2)*ch(n)*C((n-1)/2); # A002995
    a:=n->p2(n)+add(binomial(2*k,k)*p2(n-k)/2,k=1..n-1); [valid for n >= 1]

A003238 Number of rooted trees with n vertices in which vertices at the same level have the same degree.

Original entry on oeis.org

1, 1, 2, 3, 5, 6, 10, 11, 16, 19, 26, 27, 40, 41, 53, 61, 77, 78, 104, 105, 134, 147, 175, 176, 227, 233, 275, 294, 350, 351, 438, 439, 516, 545, 624, 640, 774, 775, 881, 924, 1069, 1070, 1265, 1266, 1444, 1521, 1698, 1699
Offset: 1

Views

Author

Keywords

Comments

Also, number of sequences of positive integers b_1, b_2, ..., b_k such that 1 + b_1*(1 + b_2*(...(1 + b_k) ... )) = n. If you take mu(b_1)*mu(b_2)*...*mu(b_k) for each sequence you get 1's 0's and -1's. Add them up and you get the terms for A007554. - Christian G. Bower, Oct 15 1998
Note that this applies also to planar rooted trees and other similar objects (mountain ranges, parenthesizations) encoded by A014486. - Antti Karttunen, Sep 07 2000
Equals sum of (n-1)-th row terms of triangle A152434. - Gary W. Adamson, Dec 04 2008
Equals the eigensequence of A051731, the inverse binomial transform. - Gary W. Adamson, Dec 26 2008
From Emeric Deutsch, Aug 18 2012: (Start)
The considered rooted trees are called generalized Bethe trees; in the Goldberg-Livshitz reference they are called uniform trees.
Also, a(n) = number of partitions of n-1 in which each part is divisible by the next. Example: a(5)=5 because we have 4, 31, 22, 211, and 1111.
There is a simple bijection between generalized Bethe trees with n+1 vertices and partitions of n in which each part is divisible by the next (the parts are given by the number of edges at the successive levels). We have the correspondences: number of edges --- sum of parts; root degree --- last part; number of leaves --- first part; height --- number of parts. (End)
a(n+1) = a(n) + 1 if and only if n is prime. - Jon Perry, Nov 24 2012
According to the MathOverflow link, log(a(n)) ~ log(4)*log(n)^2, and a more precise asymptotic expansion is similar to that of A018819 and hence A000123, so the conjecture in the Formula section is partly correct. - Andrey Zabolotskiy, Jan 22 2017

Examples

			a(4) = 3 because we have the path P(4), the tree Y, and the star \|/ . - _Emeric Deutsch_, Aug 18 2012
The planted achiral trees with up to 7 nodes are:
 1  -
 1  (-)
 2  (--),     ((-))
 3  (---),    ((--)),      (((-)))
 5  (----),   ((-)(-)),    ((---)),    (((--))),     ((((-))))
 6  (-----),  ((----)),    (((-)(-))), (((---))),    ((((--)))), (((((-)))))
10 (------), ((-)(-)(-)), ((--)(--)), (((-))((-))), ((-----)),  (((----))), ((((-)(-)))), ((((---)))), (((((--))))), ((((((-)))))). - _Gus Wiseman_, Jan 12 2017
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Row sums of A122934 (offset by 1).

Programs

  • Haskell
    a003238 n = a003238_list !! (n-1)
    a003238_list = 1 : f 1 where
       f x = (sum (map a003238 $ a027750_row x)) : f (x + 1)
    -- Reinhard Zumkeller, Dec 20 2014
    
  • JavaScript
    a = new Array();
    for (i = 1; i < 50; i++) a[i] = 1;
    for (i = 3; i < 50; i++) for (j = 2; j < i; j++) if (i % j == 1) a[i] += a[j];
    document.write(a + "
    "); // Jon Perry, Nov 20 2012
  • Maple
    with(numtheory): aa := proc (n) if n = 0 then 1 else add(aa(divisors(n)[i]-1), i = 1 .. tau(n)) end if end proc: a := proc (n) options operator, arrow: aa(n-1) end proc: seq(a(n), n = 1 .. 48); # Emeric Deutsch, Aug 18 2012
    A003238:= proc(n) option remember; uses numtheory; add(A003238(m),m=divisors(n-1)) end proc;
    A003238(1):= 1;
    [seq(A003238(n),n=1..48)]; # Robert Israel, Mar 10 2014
  • Mathematica
    (* b = A068336 *) b[1] = 1; b[n_] := b[n] = 1 + Sum[b[k], {k, Divisors[n-1]}]; a[n_] := b[n]/2; a[1] = 1; Table[ a[n], {n, 1, 48}] (* Jean-François Alcover, Dec 20 2011, after Ralf Stephan *)
    achi[n_]:=If[n===1,1,Total[achi/@Divisors[n-1]]];Array[achi,50] (* Gus Wiseman, Jan 12 2017 *)
  • PARI
    seq(n) = {my(v=vector(n)); v[1]=1; for(i=2, n, v[i]=sumdiv(i-1, d, v[d])); v} \\ Andrew Howroyd, Jun 08 2025

Formula

Shifts one place left under inverse Moebius transform: a(n+1) = Sum_{k|n} a(k).
Conjecture: log(a(n)) is asymptotic to c*log(n)^2 where 0.4 < c < 0.5 - Benoit Cloitre, Apr 13 2004
For n > 1, a(n) = (1/2) * A068336(n) and Sum_{k = 1..n} a(k) = A003318(n). - Ralf Stephan, Mar 27 2004
Generating function P(x) for the sequence with offset 2 obeys P(x) = x^2*(1 + Sum_{n >= 1} P(x^n)/x^n). [Harary & Robinson]. - R. J. Mathar, Sep 28 2011
a(n) = 1 + sum of a(i) such that n == 1 (mod i). - Jon Perry, Nov 20 2012
From Ilya Gutkovskiy, Apr 28 2019: (Start)
G.f.: x * (1 + Sum_{n>=1} a(n)*x^n/(1 - x^n)).
L.g.f.: -log(Product_{n>=1} (1 - x^n)^(a(n)/n)) = Sum_{n>=1} a(n+1)*x^n/n. (End)

Extensions

Description improved by Christian G. Bower, Oct 15 1998

A003239 Number of rooted planar trees with n non-root nodes: circularly cycling the subtrees at the root gives equivalent trees.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 80, 246, 810, 2704, 9252, 32066, 112720, 400024, 1432860, 5170604, 18784170, 68635478, 252088496, 930138522, 3446167860, 12815663844, 47820447028, 178987624514, 671825133648, 2528212128776, 9536895064400, 36054433810102, 136583761444364, 518401146543812
Offset: 0

Views

Author

Keywords

Comments

Also number of necklaces with 2*n beads, n white and n black (to get the correspondence, start at root, walk around outside of tree, use white if move away from the root, black if towards root).
Also number of terms in polynomial expression for permanent of generic circulant matrix of order n.
a(n) is the number of equivalence classes of n-compositions of n under cyclic rotation. (Given a necklace, split it into runs of white followed by a black bead and record the lengths of the white runs. This gives an n-composition of n.) a(n) is the number of n-multisets in Z mod n whose sum is 0. - David Callan, Nov 05 2003
a(n) is the number of cyclic equivalence classes of triangulations of a once-punctured n-gon. - Esther Banaian, May 06 2025

Examples

			As _David Callan_ said, a(n) is the number of n-multisets in Z mod n whose sum is 0. So for n = 4 the a(4)=10 multisets are (0, 0, 0, 0), (1, 1, 1, 1), (0, 1, 1, 2), (0, 0, 2, 2), (2, 2, 2, 2), (0, 0, 1, 3), (1, 2, 2, 3), (1, 1, 3, 3), (0, 2, 3, 3) and (3, 3, 3, 3). - _Boas Bakker_, Apr 21 2025
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 305 (see R(x)).
  • F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973; page 80, Problem 3.13.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.112(b).

Crossrefs

Column k=2 of A208183.
Column k=1 of A261494.

Programs

  • Maple
    with(numtheory): A003239 := proc(n) local t1,t2,d; t2 := divisors(n); t1 := 0; for d in t2 do t1 := t1+phi(n/d)*binomial(2*d,d)/(2*n); od; t1; end;
    spec := [ C, {B=Union(Z,Prod(B,B)), C=Cycle(B)}, unlabeled ]; [seq(combstruct[count](spec, size=n), n=0..40)];
  • Mathematica
    a[n_] := Sum[ EulerPhi[n/k]*Binomial[2k, k]/(2n), {k, Divisors[n]}]; a[0] = 1; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Apr 11 2012 *)
  • PARI
    C(n, k)=binomial(n,k);
    a(n) = if(n<=0, n==0, sumdiv(n, d, eulerphi(n/d) * C(2*d, d)) / (2*n) );
    /* or, second formula: */
    /* a(n) = if(n<=0, n==0, sumdiv(n, d, eulerphi(n/d) * C(2*d-1,d)) / n ); */
    /* Joerg Arndt, Oct 21 2012 */
    
  • SageMath
    def A003239(n):
        if n == 0: return 1
        return sum(euler_phi(n/d)*binomial(2*d, d)/(2*n) for d in divisors(n))
    print([A003239(n) for n in (0..29)]) # Peter Luschny, Dec 10 2020

Formula

a(n) = Sum_{d|n} (phi(n/d)*binomial(2*d, d))/(2*n) for n > 0.
a(n) = (1/n)*Sum_{d|n} (phi(n/d)*binomial(2*d-1, d)) for n > 0.
a(n) = A047996(2*n, n). - Philippe Deléham, Jul 25 2006
a(n) ~ 2^(2*n-1) / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Aug 22 2015

Extensions

Sequence corrected and extended by Roderick J. Fletcher (yylee(AT)mail.ncku.edu.tw), Aug 1997
Additional comments from Michael Somos

A057501 Signature-permutation of a Catalan Automorphism: Rotate non-crossing chords (handshake) arrangements; rotate the root position of general trees as encoded by A014486.

Original entry on oeis.org

0, 1, 3, 2, 7, 8, 5, 4, 6, 17, 18, 20, 21, 22, 12, 13, 10, 9, 11, 15, 14, 16, 19, 45, 46, 48, 49, 50, 54, 55, 57, 58, 59, 61, 62, 63, 64, 31, 32, 34, 35, 36, 26, 27, 24, 23, 25, 29, 28, 30, 33, 40, 41, 38, 37, 39, 43, 42, 44, 47, 52, 51, 53, 56, 60, 129, 130, 132, 133, 134
Offset: 0

Views

Author

Antti Karttunen, Sep 03 2000; entry revised Jun 06 2014

Keywords

Comments

This is a permutation of natural numbers induced when "noncrossing handshakes", i.e., Stanley's interpretation (n), "n nonintersecting chords joining 2n points on the circumference of a circle", are rotated.
The same permutation is induced when the root position of plane trees (Stanley's interpretation (e)) is successively changed around the vertices.
For a good illustration how the rotation of the root vertex works, please see the Figure 6, "Rotation of an ordered rooted tree" in Torsten Mütze's paper (on page 24 in 20 May 2014 revision).
For yet another application of this permutation, please see the attached notes for A085197.
By "recursivizing" either the left or right hand side argument of A085201 in the formula, one ends either with A057161 or A057503. By "recursivizing" the both sides, one ends with A057505. - Antti Karttunen, Jun 06 2014

Crossrefs

Inverse: A057502.
Also, a "SPINE"-transform of A074680, and thus occurs as row 17 of A122203. (Also as row 65167 of A130403.)
Successive powers of this permutation, a^2(n) - a^6(n): A082315, A082317, A082319, A082321, A082323.
Cf. also A057548, A072771, A072772, A085201, A002995 (cycle counts), A057543 (max cycle lengths), A085197, A129599, A057517, A064638, A064640.

Programs

  • Maple
    map(CatalanRankGlobal,map(RotateHandshakes, A014486));
    RotateHandshakes := n -> pars2binexp(RotateHandshakesP(binexp2pars(n)));
    RotateHandshakesP := h -> `if`((0 = nops(h)),h,[op(car(h)),cdr(h)]); # This does the trick! In Lisp: (defun RotateHandshakesP (h) (append (car h) (list (cdr h))))
    car := proc(a) if 0 = nops(a) then ([]) else (op(1,a)): fi: end: # The name is from Lisp, takes the first element (head) of the list.
    cdr := proc(a) if 0 = nops(a) then ([]) else (a[2..nops(a)]): fi: end: # As well. Takes the rest (the tail) of the list.
    PeelNextBalSubSeq := proc(nn) local n,z,c; if(0 = nn) then RETURN(0); fi; n := nn; c := 0; z := 0; while(1 = 1) do z := 2*z + (n mod 2); c := c + (-1)^n; n := floor(n/2); if(c >= 0) then RETURN((z - 2^(floor_log_2(z)))/2); fi; od; end;
    RestBalSubSeq := proc(nn) local n,z,c; n := nn; c := 0; while(1 = 1) do c := c + (-1)^n; n := floor(n/2); if(c >= 0) then break; fi; od; z := 0; c := -1; while(1 = 1) do z := 2*z + (n mod 2); c := c + (-1)^n; n := floor(n/2); if(c >= 0) then RETURN(z/2); fi; od; end;
    pars2binexp := proc(p) local e,s,w,x; if(0 = nops(p)) then RETURN(0); fi; e := 0; for s in p do x := pars2binexp(s); w := floor_log_2(x); e := e * 2^(w+3) + 2^(w+2) + 2*x; od; RETURN(e); end;
    binexp2pars := proc(n) option remember; `if`((0 = n),[],binexp2parsR(binrev(n))); end;
    binexp2parsR := n -> [binexp2pars(PeelNextBalSubSeq(n)),op(binexp2pars(RestBalSubSeq(n)))];
    # Procedure CatalanRankGlobal given in A057117, other missing ones in A038776.

Formula

a(0) = 0, and for n>=1, a(n) = A085201(A072771(n), A057548(A072772(n))). [This formula reflects directly the given non-destructive Lisp/Scheme function: A085201 is a 2-ary function corresponding to 'append', A072771 and A072772 correspond to 'car' and 'cdr' (known also as first/rest or head/tail in some dialects), and A057548 corresponds to unary form of function 'list'].
As a composition of related permutations:
a(n) = A057509(A069770(n)).
a(n) = A057163(A069773(A057163(n))).
Invariance-identities:
A129599(a(n)) = A129599(n) holds for all n.

A057502 Permutation of natural numbers: rotations of non-crossing handshakes encoded by A014486 (to opposite direction of A057501).

Original entry on oeis.org

0, 1, 3, 2, 7, 6, 8, 4, 5, 17, 16, 18, 14, 15, 20, 19, 21, 9, 10, 22, 11, 12, 13, 45, 44, 46, 42, 43, 48, 47, 49, 37, 38, 50, 39, 40, 41, 54, 53, 55, 51, 52, 57, 56, 58, 23, 24, 59, 25, 26, 27, 61, 60, 62, 28, 29, 63, 30, 31, 32, 64, 33, 34, 35, 36, 129, 128, 130, 126, 127
Offset: 0

Views

Author

Antti Karttunen, Sep 03 2000

Keywords

Comments

In A057501 and A057502, the cycles between (A014138(n-1)+1)-th and (A014138(n))-th term partition A000108(n) objects encoded by the corresponding terms of A014486 into A002995(n+1) equivalence classes of planar trees, thus the latter sequence can be produced also with Maple procedure RotHandshakesPermutationCycleCounts given below.

Crossrefs

Inverse of A057501 and the car/cdr-flipped conjugate of A069774, i.e. A057502(n) = A057163(A069774(A057163(n))). Cf. also A057507, A057510, A057513, A069771, A069772.

Programs

  • Maple
    map(CatalanRankGlobal,map(RotateHandshakesR, A014486));
    RotateHandshakesR := n -> pars2binexp(deepreverse(RotateHandshakesP(deepreverse(binexp2pars(n)))));
    deepreverse := proc(a) if 0 = nops(a) or list <> whattype(a) then (a) else [op(deepreverse(cdr(a))), deepreverse(a[1])]; fi; end;
    with(group); CountCycles := b -> (nops(convert(b,'disjcyc')) + (nops(b)-convert(map(nops,convert(b,'disjcyc')),`+`)));
    RotHandshakesPermutationCycleCounts := proc(upto_n) local u,n,a,r,b; a := []; for n from 0 to upto_n do b := []; u := (binomial(2*n,n)/(n+1)); for r from 0 to u-1 do b := [op(b),1+CatalanRank(n,RotateHandshakes(CatalanUnrank(n,r)))]; od; a := [op(a),CountCycles(b)]; od; RETURN(a); end;
    # For other procedures, follow A057501.

A054357 Number of unlabeled 2-ary cacti having n polygons. Also number of bicolored plane trees with n edges.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 28, 63, 190, 546, 1708, 5346, 17428, 57148, 191280, 646363, 2210670, 7626166, 26538292, 93013854, 328215300, 1165060668, 4158330416, 14915635378, 53746119972, 194477856100, 706437056648, 2575316704200, 9419571138368
Offset: 0

Views

Author

Keywords

Comments

a(n) = the number of inequivalent non-crossing partitions of n points (equally spaced) on a circle, under rotations of the circle. This may be considered the number of non-crossing partitions of n unlabeled points on a circle, so this sequence has the same relation to the Catalan numbers (A000108) as the number of partitions of an integer (A000041) has to the Bell numbers (A000110). - Len Smiley, Sep 06 2005

Crossrefs

Column k=2 of A303912.
Row sums of A209805.

Programs

  • Mathematica
    a[n_] := If[n == 0, 1, (Binomial[2*n, n]/(n + 1) + DivisorSum[n, Binomial[2*#, #]*EulerPhi[n/#]*Boole[# < n] & ])/n]; Table[a[n], {n, 0, 28}] (* Jean-François Alcover, Jul 17 2017 *)
  • PARI
    a(n)=if(n==0, 1, (binomial(2*n, n)/(n + 1) + sumdiv(n, d, binomial(2*d, d)*eulerphi(n/d)*(dIndranil Ghosh, Jul 17 2017
    
  • PARI
    a(n) = if(n==0, 1, sumdiv(n, d, eulerphi(n/d)*binomial(2*d, d))/n - binomial(2*n, n)/(n+1)) \\ Andrew Howroyd, May 02 2018
    
  • Python
    from sympy import binomial, divisors, totient
    def a(n): return 1 if n==0 else (binomial(2*n, n)//(n + 1) + sum(binomial(2*d, d)*totient(n//d)*(dIndranil Ghosh, Jul 17 2017

Formula

a(n) = (1/n)*(Sum_{d|n} phi(n/d)*binomial(2*d, d)) - binomial(2*n, n)/(n+1) for n > 0. - Andrew Howroyd, May 02 2018
a(n) ~ 2^(2*n) / (sqrt(Pi) * n^(5/2)). - Vaclav Kotesovec, Jul 17 2017

Extensions

More terms from Len Smiley, Sep 06 2005
More terms from Vladeta Jovovic, Oct 04 2007

A007595 a(n) = C_n / 2 if n is even or ( C_n + C_((n-1)/2) ) / 2 if n is odd, where C = Catalan numbers (A000108).

Original entry on oeis.org

1, 1, 3, 7, 22, 66, 217, 715, 2438, 8398, 29414, 104006, 371516, 1337220, 4847637, 17678835, 64823110, 238819350, 883634026, 3282060210, 12233141908, 45741281820, 171529836218, 644952073662, 2430973304732, 9183676536076, 34766775829452, 131873975875180
Offset: 1

Views

Author

Keywords

Comments

Number of necklaces of 2 colors with 2n beads and n-1 black ones. - Wouter Meeussen, Aug 03 2002
Number of rooted planar binary trees up to reflection (trees with n internal nodes, or a total of 2n+1 nodes). - Antti Karttunen, Aug 19 2002
Number of even permutations avoiding 132.
Number of Dyck paths of length 2n having an even number of peaks at even height. Example: a(3)=3 because we have UDUDUD, U(UD)(UD)D and UUUDDD, where U=(1,1), D=(1,-1) and the peaks at even height are shown between parentheses. - Emeric Deutsch, Nov 13 2004
Number of planar trees (A002995) on n edges with one distinguished edge. - David Callan, Oct 08 2005
Assuming offset 0 this is an analog of A275165: pairs of two Catalan nestings with index sum n. - R. J. Mathar, Jul 19 2016

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) = A047996(2*n, n-1) for n >= 1 and a(n) = A072506(n, n-1) for n >= 2.
Occurs in A073201 as rows 0, 2, 4, etc. (with a(0)=1 included).
Cf. also A003444, A007123.

Programs

  • Maple
    A007595 := n -> (1/2)*(Cat(n) + (`mod`(n,2)*Cat((n-1)/2))); Cat := n -> binomial(2*n,n)/(n+1);
  • Mathematica
    Table[(Plus@@(EulerPhi[ # ]Binomial[2n/#, (n-1)/# ] &)/@Intersection[Divisors[2n], Divisors[n-1]])/(2n), {n, 2, 32}] (* or *) Table[If[EvenQ[n], CatalanNumber[n]/2, (CatalanNumber[n] + CatalanNumber[(n-1)/2])/2], {n, 24}]
    Table[(CatalanNumber[n] + 2^n Binomial[1/2, (n + 1)/2] Sin[Pi n/2])/2, {n, 1, 20}] (* Vladimir Reshetnikov, Oct 03 2016 *)
    Table[If[EvenQ[n],CatalanNumber[n]/2,(CatalanNumber[n]+CatalanNumber[(n-1)/2])/2],{n,30}] (* Harvey P. Dale, Sep 06 2021 *)
  • PARI
    catalan(n) = binomial(2*n, n)/(n+1);
    a(n) = if (n % 2, (catalan(n) + catalan((n-1)/2))/2, catalan(n)/2); \\ Michel Marcus, Jan 23 2016

Formula

G.f.: (2-2*x-sqrt(1-4*x)-sqrt(1-4*x^2))/x/4. - Vladeta Jovovic, Sep 26 2003
D-finite with recurrence: n*(n+1)*a(n) -6*n*(n-1)*a(n-1) +4*(2*n^2-10*n+9)*a(n-2) +8*(n^2+n-9)*a(n-3) -48*(n-3)*(n-4)*a(n-4) +32*(2*n-9)*(n-5)*a(n-5)=0. - R. J. Mathar, Jun 03 2014, adapted to offset Feb 20 2020
a(n) ~ 4^n /(2*sqrt(Pi)*n^(3/2)). - Ilya Gutkovskiy, Jul 19 2016
a(2n) = A000150(2n). - R. J. Mathar, Jul 19 2016
a(n) = (A000108(n) + 2^n * binomial(1/2, (n+1)/2) * sin(Pi*n/2))/2. - Vladimir Reshetnikov, Oct 03 2016
Sum_{n>=1} a(n)/4^n = (3-sqrt(3))/2 (A334843). - Amiram Eldar, Mar 20 2022

Extensions

Description corrected by Reiner Martin and Wouter Meeussen, Aug 04 2002

A061417 Number of permutations up to cyclic rotations; permutation siteswap necklaces.

Original entry on oeis.org

1, 2, 4, 10, 28, 136, 726, 5100, 40362, 363288, 3628810, 39921044, 479001612, 6227066928, 87178295296, 1307675013928, 20922789888016, 355687438476444, 6402373705728018, 121645100594641896, 2432902008177690360, 51090942175425331320, 1124000727777607680022
Offset: 1

Views

Author

Antti Karttunen, May 02 2001

Keywords

Comments

If permutations are converted to (i,p(i)) permutation arrays, then this automorphism is obtained by their "SW-NE diagonal toroidal shifts" (see Matthias Engelhardt's Java program in A006841), while the Maple procedure below converts each permutation to a siteswap pattern (used in juggling), rotates it by one digit and converts the resulting new (or same) siteswap pattern back to a permutation.
When the subset of permutations listed by A064640 are subjected to the same automorphism one gets A002995.
The number of conjugacy classes of the symmetric group of degree n when conjugating only with the cyclic permutation group of degree n. - Attila Egri-Nagy, Aug 15 2014
Also the number of equivalence classes of permutations of {1...n} under the action of rotation of vertices in the cycle decomposition. The corresponding action on words applies m -> m + 1 for m < n and n -> 1, and rotates once to the right. For example, (24531) first becomes (35142) under the application of cyclic rotation, and then is rotated right to give (23514). - Gus Wiseman, Mar 04 2019

Examples

			If I have a five-element permutation like 25431, in cycle notation (1 2 5)(3 4), I mark the numbers 1-5 clockwise onto a circle and draw directed edges from 1 to 2, from 2 to 5, from 5 to 1 and a double-way edge between 3 and 4. All the 5-element permutations that produce some rotation (discarding the labels of the nodes) of that chord diagram belong to the same equivalence class with 25431. The sequence gives the count of such equivalence classes.
		

Crossrefs

Cf. A006841, A060495. For other Maple procedures, see A060501 (Perm2SiteSwap2), A057502 (CountCycles), A057509 (rotateL), A060125 (PermRank3R and permul).
A061417[p] = A061860[p] = (p-1)!+(p-1) for all prime p's.
A064636 (derangements-the same automorphism).
A061417[n] = A064649[n]/n.
Cf. A000031, A000939, A002995, A008965, A060223, A064640, A086675 (digraphical necklaces), A179043, A192332, A275527 (path necklaces), A323858, A323859, A323870, A324513, A324514 (aperiodic permutations).

Programs

  • GAP
    List([1..10],n->Size( OrbitsDomain( CyclicGroup(IsPermGroup,n), SymmetricGroup( IsPermGroup,n),\^))); # Attila Egri-Nagy, Aug 15 2014
    
  • Haskell
    a061417 = sum . a047917_row  -- Reinhard Zumkeller, Mar 19 2014
    
  • Maple
    Algebraic formula: with(numtheory); SSRPCC := proc(n) local d,s; s := 0; for d in divisors(n) do s := s + phi(n/d)*((n/d)^d)*(d!); od; RETURN(s/n); end;
    Empirically: with(group); SiteSwapRotationPermutationCycleCounts := proc(upto_n) local b,u,n,a,r; a := []; for n from 1 to upto_n do b := []; u := n!; for r from 0 to u-1 do b := [op(b),1+PermRank3R(SiteSwap2Perm1(rotateL(Perm2SiteSwap2(PermUnrank3Rfix(n,r)))))]; od; a := [op(a),CountCycles(b)]; od; RETURN(a); end;
    PermUnrank3Rfixaux := proc(n,r,p) local s; if(0 = n) then RETURN(p); else s := floor(r/((n-1)!)); RETURN(PermUnrank3Rfixaux(n-1, r-(s*((n-1)!)), permul(p,[[n,n-s]]))); fi; end;
    PermUnrank3Rfix := (n,r) -> convert(PermUnrank3Rfixaux(n,r,[]),'permlist',n);
    SiteSwap2Perm1 := proc(s) local e,n,i,a; n := nops(s); a := []; for i from 1 to n do e := ((i+s[i]) mod n); if(0 = e) then e := n; fi; a := [op(a),e]; od; RETURN(convert(invperm(convert(a,'disjcyc')),'permlist',n)); end;
  • Mathematica
    a[n_] := (1/n)*Sum[ EulerPhi[n/d]*(n/d)^d*d!, {d, Divisors[n]}]; Table[a[n], {n, 1, 21}] (* Jean-François Alcover, Oct 09 2012, from formula *)
    Table[Length[Select[Permutations[Range[n]],#==First[Sort[NestList[RotateRight[#/.k_Integer:>If[k==n,1,k+1]]&,#,n-1]]]&]],{n,8}] (* Gus Wiseman, Mar 04 2019 *)
  • PARI
    a(n) = (1/n)*sumdiv(n, d, eulerphi(n/d)*(n/d)^d*d!); \\ Indranil Ghosh, Apr 10 2017
    
  • Python
    from sympy import divisors, factorial, totient
    def a(n):
        return sum(totient(n//d)*(n//d)**d*factorial(d) for d in divisors(n))//n
    print([a(n) for n in range(1, 22)]) # Indranil Ghosh, Apr 10 2017

Formula

a(n) = (1/n)*Sum_{d|n} phi(n/d)*((n/d)^d)*(d!).

A303694 Array read by antidiagonals: T(n,k) is the number of noncrossing partitions up to rotation composed of n blocks of size k.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 3, 7, 6, 1, 1, 1, 1, 3, 11, 19, 14, 1, 1, 1, 1, 4, 17, 52, 86, 34, 1, 1, 1, 1, 4, 25, 102, 307, 372, 95, 1, 1, 1, 1, 5, 33, 187, 811, 1936, 1825, 280, 1, 1, 1, 1, 5, 43, 300, 1772, 6626, 13207, 9143, 854, 1
Offset: 0

Views

Author

Andrew Howroyd, Apr 28 2018

Keywords

Comments

Also, the number of unlabeled planar k-gonal cacti having n polygons.
The number of noncrossing partitions counted distinctly is given by A070914(n,k-1).

Examples

			Array begins:
==================================================================
n\k| 1   2    3     4      5       6       7        8        9
---+--------------------------------------------------------------
0  | 1   1    1     1      1       1       1        1        1 ...
1  | 1   1    1     1      1       1       1        1        1 ...
2  | 1   1    1     1      1       1       1        1        1 ...
3  | 1   2    2     3      3       4       4        5        5 ...
4  | 1   3    7    11     17      25      33       43       55 ...
5  | 1   6   19    52    102     187     300      463      663 ...
6  | 1  14   86   307    811    1772    3412     5993     9821 ...
7  | 1  34  372  1936   6626   17880   40770    82887   154079 ...
8  | 1  95 1825 13207  58385  191967  518043  1213879  2558305 ...
9  | 1 280 9143 93496 532251 2141232 6830545 18471584 44121134 ...
...
		

Crossrefs

Programs

  • Mathematica
    T[0, _] = 1;
    T[n_, k_] := (DivisorSum[n, EulerPhi[n/#] Binomial[k #, #]&] + DivisorSum[ GCD[n-1, k], EulerPhi[#] Binomial[n k/#, (n-1)/#]&])/(k n) - Binomial[k n, n]/(n (k-1) + 1);
    Table[T[n-k, k], {n, 0, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, May 22 2018 *)
  • PARI
    T(n,k)={if(n==0, 1, (sumdiv(n,d,eulerphi(n/d)*binomial(k*d,d)) + sumdiv(gcd(n-1,k), d, eulerphi(d)*binomial(n*k/d, (n-1)/d)))/(k*n) - binomial(k*n,n)/(n*(k-1)+1))}

Formula

T(n,k) = ((Sum_{d|n} phi(n/d)*binomial(k*d,d)) + (Sum_{d|gcd(n-1,k)} phi(d) * binomial(n*k/d, (n-1)/d)))/(k*n) - binomial(k*n,n)/(n*(k-1)+1) for n > 0.
T(n,k) ~ A070914(n,k-1)/(n*k) for fixed k > 1.

A057513 Number of separate orbits to which permutations given in A057511/A057512 (induced by deep rotation of general parenthesizations/plane trees) partition each A000108(n) objects encoded by A014486 between (A014138(n-1)+1)-th and (A014138(n))-th terms.

Original entry on oeis.org

1, 1, 2, 4, 9, 21, 56, 153, 451, 1357, 4212, 13308, 42898, 140276, 465324, 1561955, 5300285, 18156813, 62732842, 218405402, 765657940
Offset: 0

Views

Author

Antti Karttunen Sep 03 2000

Keywords

Comments

It is much faster to compute this sequence empirically with the given C-program than to calculate the terms with the formula in its present form.

Crossrefs

CountCycles given in A057502, for other procedures, follow A057511 and A057501.
Similarly generated sequences: A001683, A002995, A003239, A038775, A057507. Cf. also A000081.
Occurs for first time in A073201 as row 12. Cf. A057546 and also A000081.

Programs

  • Maple
    A057513 := proc(n) local i; `if`((0=n),1,(1/A003418(n-1))*add(A079216bi(n,i),i=1..A003418(n-1))); end;
    # Or empirically:
    DeepRotatePermutationCycleCounts := proc(upto_n) local u,n,a,r,b; a := []; for n from 0 to upto_n do b := []; u := (binomial(2*n,n)/(n+1)); for r from 0 to u-1 do b := [op(b),1+CatalanRank(n,DeepRotateL(CatalanUnrank(n,r)))]; od; a := [op(a),CountCycles(b)]; od; RETURN(a); end;

Formula

a(0)=1, a(n) = (1/A003418(n-1))*Sum_{i=1..A003418(n-1)} A079216(n, i) [Needs improvement.] - Antti Karttunen, Jan 03 2003
Showing 1-10 of 34 results. Next