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

A215251 Product of terms in n-th row of A037306.

Original entry on oeis.org

1, 1, 1, 2, 4, 36, 225, 7840, 313600, 45302400, 8930250000, 8373836401920, 9001015156742400, 41813367543204433176, 325385777102562972821025, 8270190445766978650521600000, 377177413291384771899817984000000, 62187743659065606074696974956949929984
Offset: 1

Views

Author

N. J. A. Sloane, Sep 05 2012

Keywords

Comments

Also products of terms in rows of A047996.

Crossrefs

Programs

  • Maple
    with (numtheory):
    a:= n-> mul (add(phi(d)*binomial(n/d, k/d),
                         d=divisors(igcd(n, k))), k=0..n)/n^(n+1):
    seq (a(n), n=1..20);  # Alois P. Heinz, Sep 06 2012
  • Mathematica
    t[n_, k_] := Total[EulerPhi[#] * Binomial[n/#, k/#]& /@ Divisors[GCD[n, k]]]/n; Table[Times @@ Table[t[n, k], {k, 1, n}], {n, 1, 18}] (* Jean-François Alcover, Mar 07 2014 *)

A008965 Number of necklaces of sets of beads containing a total of n beads.

Original entry on oeis.org

1, 2, 3, 5, 7, 13, 19, 35, 59, 107, 187, 351, 631, 1181, 2191, 4115, 7711, 14601, 27595, 52487, 99879, 190745, 364723, 699251, 1342183, 2581427, 4971067, 9587579, 18512791, 35792567, 69273667, 134219795, 260301175, 505294127, 981706831, 1908881899, 3714566311, 7233642929
Offset: 1

Views

Author

Keywords

Comments

A necklace of sets of beads is a cycle where each element of the cycle is itself a set of beads, the total size being the total number of beads.
Equivalently, a(n) is the number of cyclic compositions of n. These could also be loosely described as cyclic partitions.
Inverse Mobius transform of A059966. - Jianing Song, Nov 13 2021
This sequence seems to represent the number of modal families (i.e., sets of scales who are each other's modes) in a musical tuning with n notes per octave. - Luke Knotts, May 28 2025

Examples

			E.g. the 5 necklaces for n=4 are (3, 1), (4), (1, 1, 1, 1), (2, 1, 1), (2, 2).
In the Combstruct language these can be described as Cycle(Set(Z), Set(Z), Set(Z), Set(Z)), Cycle(Set(Z, Z), Set(Z), Set(Z)), Cycle(Set(Z, Z, Z, Z)), Cycle(Set(Z, Z), Set(Z, Z)), Cycle(Set(Z), Set(Z, Z, Z)).
For n=6 the 13 necklaces are
   1:  (1, 1, 1, 1, 1, 1),
   2:  (2, 1, 1, 1, 1),
   3:  (2, 1, 2, 1),
   4:  (2, 2, 1, 1),
   5:  (2, 2, 2),
   6:  (3, 1, 1, 1),
   7:  (3, 1, 2),
   8:  (3, 2, 1),
   9:  (3, 3),
  10:  (4, 1, 1),
  11:  (4, 2),
  12:  (5, 1),
  13:  (6).
[corrected by Marcel Vonk (mail(AT)marcelvonk.nl), Feb 05 2008]
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 520, Table 8.13.

Crossrefs

Row sums of A037306. CIK transform of A057427.
Cf. A000031.

Programs

  • Maple
    with(combstruct): seq(combstruct[count]([ N,{N=Cycle(Set(Z,card>=1))},unlabeled ], size=n), n=1..100);
  • Mathematica
    a[n_] := Sum[ EulerPhi[d]*2^(n/d), {d, Divisors[n]}]/n-1; Table[a[n], {n, 1, 38}] (* Jean-François Alcover, Sep 04 2012, from A000031 *)
    nn=35; Drop[Apply[Plus,Table[CoefficientList[Series[CycleIndex[ CyclicGroup[n],s]/.Table[s[i]->x^i/(1-x^i),{i,1,n}],{x,0,nn}],x],{n,1,nn}]],1]  (* Geoffrey Critzer, Oct 30 2012 *)
  • PARI
    N=66;  x='x+O('x^N);
    B(x)=x/(1-x);
    A=sum(k=1,N,eulerphi(k)/k*log(1/(1-B(x^k))));
    Vec(A)
    /* Joerg Arndt, Aug 06 2012 */
    
  • Python
    from sympy import totient, divisors
    def A008965(n): return sum(totient(d)*(1<Chai Wah Wu, Sep 23 2023

Formula

a(n) = A000031(n) - 1.
G.f.: Sum_{k>=1} phi(k)/k * log( 1/(1-B(x^k)) ) where B(x)=x/(1-x); see the Flajolet/Soria reference. - Joerg Arndt, Aug 06 2012
From Jianing Song, Nov 13 2021: (Start)
a(n) = Sum_{d|(2^n-1)} phi(d)/ord(2,d), where phi = A000010 and ord(2,d) is the multiplicative order of 2 modulo d.
Dirichlet g.f.: zeta(s) * (f(s+1)/zeta(s+1) - 1), where f(s) = Sum_{n>=1} 2^n/n^s. (End)

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

A047996 Triangle read by rows: T(n,k) is the (n,k)-th circular binomial coefficient, where 0 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 4, 3, 1, 1, 1, 1, 3, 5, 5, 3, 1, 1, 1, 1, 4, 7, 10, 7, 4, 1, 1, 1, 1, 4, 10, 14, 14, 10, 4, 1, 1, 1, 1, 5, 12, 22, 26, 22, 12, 5, 1, 1, 1, 1, 5, 15, 30, 42, 42, 30, 15, 5, 1, 1, 1, 1, 6, 19, 43, 66, 80, 66, 43, 19, 6, 1, 1, 1, 1, 6, 22
Offset: 0

Views

Author

Keywords

Comments

Equivalently, T(n,k) = number of necklaces with k black beads and n-k white beads (binary necklaces of weight k).
The same sequence arises if we take the table U(n,k) = number of necklaces with n black beads and k white beads and read it by antidiagonals (cf. A241926). - Franklin T. Adams-Watters, May 02 2014
U(n,k) is also equal to the number of ways to express 0 as a sum of k elements in Z/nZ. - Jens Voß, Franklin T. Adams-Watters, N. J. A. Sloane, Apr 30 2014 - May 05 2014. See link ("A Note on Modular Partitions and Necklaces") for proof.
The generating function for column k is given by the substitution x_j -> x^j/(1-x^j) in the cycle index of the Symmetric Group of order k. - R. J. Mathar, Nov 15 2018
From Petros Hadjicostas, Jul 12 2019: (Start)
Regarding the comments above by Voss, Adams-Watters, and Sloane, note that Fredman (1975) proved that the number S(n, k, v) of vectors (a_0, ..., a_{n-1}) of nonnegative integer components that satisfy a_0 + ... + a_{n-1} = k and Sum_{i=0..n-1} i*a_i = v (mod n) is given by S(n, k, v) = (1/(n + k)) * Sum_{d | gcd(n, k)} A054535(d, v) * binomial((n + k)/d, k/d) = S(k, n, v).
This result was also proved by Elashvili et al. (1999), who also proved that S(n, k, v) = Sum_{d | gcd(n, k, v)} S(n/d, k/d, 1). Here, S(n, k, 0) = A241926(n, k) = U(n, k) = T(n + k, k) (where T(n, k) is the current array). Also, S(n, k, 1) = A245558(n, k). See also Panyushev (2011) for more general results and for generating functions.
Finally, note that A054535(d, v) = c_d(v) = Sum_{s | gcd(d,v)} s*Moebius(d/s). These are the Ramanujan sums, which equal also the von Sterneck function c_d(v) = phi(d) * Moebius(d/gcd(d, v))/phi(d/gcd(d, v)). We have A054535(d, v) = A054534(v, d).
It would be interesting to see whether there is a proof of the results by Fredman (1975), Elashvili et al. (1999), and Panyushev (2011) for a general v using Molien series as it is done by Sloane (2014) for the case v = 0 (in which case, A054535(d, 0) = phi(d)). (Even though the columns of array A054535(d, v) start at v = 1, we may start the array at column v = 0 as well.)
(End)
U(n, k) is the number of equivalence classes of k-tuples of residues modulo n, identifying those that differ componentwise by a constant and those that differ by a permutation. - Álvar Ibeas, Sep 21 2021

Examples

			Triangle starts:
[ 0]  1,
[ 1]  1,  1,
[ 2]  1,  1,  1,
[ 3]  1,  1,  1,  1,
[ 4]  1,  1,  2,  1,  1,
[ 5]  1,  1,  2,  2,  1,  1,
[ 6]  1,  1,  3,  4,  3,  1,  1,
[ 7]  1,  1,  3,  5,  5,  3,  1,  1,
[ 8]  1,  1,  4,  7, 10,  7,  4,  1,  1,
[ 9]  1,  1,  4, 10, 14, 14, 10,  4,  1,  1,
[10]  1,  1,  5, 12, 22, 26, 22, 12,  5,  1, 1,
[11]  1,  1,  5, 15, 30, 42, 42, 30, 15,  5, 1, 1,
[12]  1,  1,  6, 19, 43, 66, 80, 66, 43, 19, 6, 1, 1, ...
		

References

  • N. G. de Bruijn, Polya's theory of counting, in: Applied Combinatorial Mathematics (E. F. Beckenbach, ed.), John Wiley and Sons, New York, 1964, pp. 144-184 (implies g.f. for this triangle).
  • Richard Stanley, Enumerative Combinatorics, 2nd. ed., Vol 1, Chapter I, Problem 105, pp. 122 and 168, discusses the number of subsets of Z/nZ that add to 0. - N. J. A. Sloane, May 06 2014
  • J. Voß, Posting to Sequence Fans Mailing List, April 30, 2014.
  • H. S. Wilf, personal communication to N. J. A. Sloane, Nov., 1990.
  • See A000031 for many additional references and links.

Crossrefs

Row sums: A000031. Columns 0-12: A000012, A000012, A004526, A007997(n+5), A008610, A008646, A032191-A032197.
See A037306 and A241926 for essentially identical triangles.
See A245558, A245559 for a closely related array.

Programs

  • Maple
    A047996 := proc(n,k) local C,d; if k= 0 then return 1; end if; C := 0 ; for d in numtheory[divisors](igcd(n,k)) do C := C+numtheory[phi](d)*binomial(n/d,k/d) ; end do: C/n ; end proc:
    seq(seq(A047996(n,k),k=0..n),n=0..10) ; # R. J. Mathar, Apr 14 2011
  • Mathematica
    t[n_, k_] := Total[EulerPhi[#]*Binomial[n/#, k/#] & /@ Divisors[GCD[n, k]]]/n; t[0, 0] = 1; Flatten[Table[t[n, k], {n, 0, 13}, {k, 0, n}]] (* Jean-François Alcover, Jul 19 2011, after given formula *)
  • PARI
    p(n) = if(n<=0, n==0, 1/n * sum(i=0,n-1, (x^(n/gcd(i,n))+1)^gcd(i,n) ));
    for (n=0,17, print(Vec(p(n)))); /* print triangle */
    /* Joerg Arndt, Sep 28 2012 */
    
  • PARI
    T(n,k) = if(n<=0, n==0, 1/n * sumdiv(gcd(n,k), d, eulerphi(d)*binomial(n/d,k/d) ) );
    /* print triangle: */
    { for (n=0, 17, for (k=0, n, print1(T(n,k),", "); ); print(); ); }
    /* Joerg Arndt, Oct 21 2012 */

Formula

T(n, k) = (1/n) * Sum_{d | (n, k)} phi(d)*binomial(n/d, k/d).
T(2*n,n) = A003239(n); T(2*n+1,n) = A000108(n). - Philippe Deléham, Jul 25 2006
G.f. for row n (n>=1): (1/n) * Sum_{i=0..n-1} ( x^(n/gcd(i,n)) + 1 )^gcd(i,n). - Joerg Arndt, Sep 28 2012
G.f.: Sum_{n, k >= 0} T(n, k)*x^n*y^k = 1 - Sum_{s>=1} (phi(s)/s)*log(1-x^s*(1+y^s)). - Petros Hadjicostas, Oct 26 2017
Product_{d >= 1} (1 - x^d - y^d) = Product_{i,j >= 0} (1 - x^i*y^j)^T(i+j, j), where not both i and j are zero. (It follows from Somos' infinite product for array A051168.) - Petros Hadjicostas, Jul 12 2019

Extensions

Name edited by Petros Hadjicostas, Nov 16 2017

A008610 Molien series of 4-dimensional representation of cyclic group of order 4 over GF(2) (not Cohen-Macaulay).

Original entry on oeis.org

1, 1, 3, 5, 10, 14, 22, 30, 43, 55, 73, 91, 116, 140, 172, 204, 245, 285, 335, 385, 446, 506, 578, 650, 735, 819, 917, 1015, 1128, 1240, 1368, 1496, 1641, 1785, 1947, 2109, 2290, 2470, 2670, 2870, 3091, 3311, 3553, 3795, 4060, 4324, 4612, 4900, 5213, 5525, 5863
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of necklaces with 4 black beads and n white beads.
Also nonnegative integer 2 X 2 matrices with sum of elements equal to n, up to rotational symmetry.
The g.f. is Z(C_4,x), the 4-variate cycle index polynomial for the cyclic group C_4, with substitution x[i]->1/(1-x^i), i=1,...,4. Therefore by Polya enumeration a(n) is the number of cyclically inequivalent 4-necklaces whose 4 beads are labeled with nonnegative integers such that the sum of labels is n, for n=0,1,2,... See A102190 for Z(C_4,x). - Wolfdieter Lang, Feb 15 2005

Examples

			There are 10 inequivalent nonnegative integer 2 X 2 matrices with sum of elements equal to 4, up to rotational symmetry:
[0 0] [0 0] [0 0] [0 0] [0 1] [0 1] [0 1] [0 2] [0 2] [1 1]
[0 4] [1 3] [2 2] [3 1] [1 2] [2 1] [3 0] [1 1] [2 0] [1 1].
		

References

  • D. J. Benson, Polynomial Invariants of Finite Groups, Cambridge, 1993, p. 104.
  • E. V. McLaughlin, Numbers of factorizations in non-unique factorial domains, Senior Thesis, Allegeny College, Meadville, PA, April 2004.

Crossrefs

Row n=2 of A343874.
Column k=4 of A037306 and A047996.

Programs

  • GAP
    a:=[1,1,3,5,10,14,22,30];; for n in [9..50] do a[n]:=2*a[n-1]-2*a[n-3] +2*a[n-4]-2*a[n-5]+2*a[n-7]-a[n-1]; od; a; # G. C. Greubel, Jan 31 2020
  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (1+2*x^3+x^4)/((1-x)*(1-x^2)^2*(1-x^4)) )); // G. C. Greubel, Jan 31 2020
    
  • Maple
    1/(1-x)/(1-x^2)^2/(1-x^4)*(1+2*x^3+x^4);
    seq(coeff(series(%, x, n+1), x, n), n=0..40);
  • Mathematica
    k = 4; Table[Apply[Plus, Map[EulerPhi[ # ]Binomial[n/#, k/# ] &, Divisors[GCD[n, k]]]]/n, {n, k, 30}] (* Robert A. Russell, Sep 27 2004 *)
    LinearRecurrence[{2,0,-2,2,-2,0,2,-1}, {1,1,3,5,10,14,22,30}, 50] (* G. C. Greubel, Jan 31 2020 *)
  • PARI
    a(n)=if(n,([0,1,0,0,0,0,0,0; 0,0,1,0,0,0,0,0; 0,0,0,1,0,0,0,0; 0,0,0,0,1,0,0,0; 0,0,0,0,0,1,0,0; 0,0,0,0,0,0,1,0; 0,0,0,0,0,0,0,1; -1,2,0,-2,2,-2,0,2]^n*[1;1;3;5;10;14;22;30])[1,1],1) \\ Charles R Greathouse IV, Oct 22 2015
    
  • PARI
    my(x='x+O('x^50)); Vec((1+2*x^3+x^4)/((1-x)*(1-x^2)^2*(1-x^4))) \\ G. C. Greubel, Jan 31 2020
    
  • Sage
    def A008610_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( (1+2*x^3+x^4)/((1-x)*(1-x^2)^2*(1-x^4)) ).list()
    A008610_list(50) # G. C. Greubel, Jan 31 2020
    

Formula

G.f.: (1+2*x^3+x^4)/((1-x)*(1-x^2)^2*(1-x^4)) = (1-x+x^2+x^3)/((1-x)^2*(1-x^2)*(1-x^4)).
a(n) = (1/48)*(2*n^3 + 3*(-1)^n*(n + 4) + 12*n^2 + 25*n + 24 + 12*cos(n*Pi/2)). - Ralf Stephan, Apr 29 2014
G.f.: (1/4)*(1/(1-x)^4 + 1/(1-x^2)^2 + 2/(1-x^4)). - Herbert Kociemba, Oct 22 2016
a(n) = -A032801(-n), per formulae of Colin Barker (A032801) and R. Stephan (above). Also, a(n) - A032801(n+4) = (1+(-1)^signum(n mod 4))/2, i.e., (1,0,0,0,1,0,0,0,...) repeating, (offset 0). - Gregory Gerard Wojnar, Jul 09 2022

Extensions

Comment and example from Vladeta Jovovic, May 18 2000

A241926 Table read by antidiagonals: T(n,k) (n >= 1, k >= 1) is the number of necklaces with n black beads and k white beads.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 3, 4, 3, 1, 1, 3, 5, 5, 3, 1, 1, 4, 7, 10, 7, 4, 1, 1, 4, 10, 14, 14, 10, 4, 1, 1, 5, 12, 22, 26, 22, 12, 5, 1, 1, 5, 15, 30, 42, 42, 30, 15, 5, 1, 1, 6, 19, 43, 66, 80, 66, 43, 19, 6, 1, 1, 6, 22, 55, 99, 132, 132, 99, 55, 22, 6, 1
Offset: 1

Views

Author

Keywords

Comments

Turning over the necklace is not allowed (the group is cyclic not dihedral). T(n,k) = T(k,n) follows immediately from the formula. - N. J. A. Sloane, May 03 2014
T(n, k) is the number of equivalence classes of k-tuples of residues modulo n, identifying those that differ componentwise by a constant and those that differ by a permutation. - Álvar Ibeas, Sep 21 2021

Examples

			The table starts:
  1, 1,  1,  1,  1,  1,   1,   1,   1,   1,   1,    1, ...
  1, 2,  2,  3,  3,  4,   4,   5,   5,   6,   6,    7, ...
  1, 2,  4,  5,  7, 10,  12,  15,  19,  22,  26,   31, ...
  1, 3,  5, 10, 14, 22,  30,  43,  55,  73,  91,  116, ...
  1, 3,  7, 14, 26, 42,  66,  99, 143, 201, 273,  364, ...
  1, 4, 10, 22, 42, 80, 132, 217, 335, 504, 728, 1038, ...
  ...
		

Crossrefs

Same as A047996 with first row and main diagonal removed.
A037306 is yet another version.
Cf. A003239 (main diagonal).
See A245558, A245559 for a closely related array.

Programs

  • Maple
    # Maple program for the table - N. J. A. Sloane, May 03 2014:
    with(numtheory);
    T:=proc(n,k) local d, s, g, t0;
    t0:=0; s:=n+k; g:=gcd(n,k);
    for d from 1 to s do
       if (g mod d) = 0 then t0:=t0+phi(d)*binomial(s/d,k/d); fi;
    od: t0/s; end;
    r:=n->[seq(T(n,k),k=1..12)];
    [seq(r(n),n=1..12)];
  • Mathematica
    T[n_, k_] := DivisorSum[GCD[n, k], EulerPhi[#] Binomial[(n+k)/#, n/#]& ]/ (n+k); Table[T[n-k+1, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Dec 02 2015 *)
  • PARI
    T(n,k) = sumdiv(gcd(n,k),d,eulerphi(d)*binomial((n+k)\d,n\d))/(n+k)

Formula

T(n,k) = (Sum_{d | gcd(n,k)} phi(d)*binomial((n+k)/d, n/d))/(n+k). [Corrected by N. J. A. Sloane, May 03 2014]

Extensions

Edited by N. J. A. Sloane, May 03 2014
Elashvili et al. references supplied by Vladimir Popov, May 17 2014

A284855 Array read by antidiagonals: T(n,k) = number of necklaces with n beads and k colors that are the same when turned over.

Original entry on oeis.org

1, 2, 1, 3, 3, 1, 4, 6, 4, 1, 5, 10, 9, 6, 1, 6, 15, 16, 18, 8, 1, 7, 21, 25, 40, 27, 12, 1, 8, 28, 36, 75, 64, 54, 16, 1, 9, 36, 49, 126, 125, 160, 81, 24, 1, 10, 45, 64, 196, 216, 375, 256, 162, 32, 1, 11, 55, 81, 288, 343, 756, 625, 640, 243, 48, 1
Offset: 1

Views

Author

Andrew Howroyd, Apr 04 2017

Keywords

Comments

Number of periodic palindromes of length n using a maximum of k different symbols.
From Petros Hadjicostas, Sep 02 2018: (Start)
According to Christian Bower's theory of transforms, we have boxes of different sizes and different colors. The size of a box is determined by the number of balls it can hold. In this case, we assume all balls are the same and are unlabeled. Assume also that the number of possible colors a box with m balls can have is given by c(m). We place the boxes on a circle at equal distances from each other. Two configurations of boxes on the circle are considered equivalent if one can be obtained from the other by rotation. We are interested about circular configurations of boxes that are circular palindromes (i.e., necklaces with boxes that are the same when turned over). Let b(n) be the number of circularly palindromic configurations of boxes on a circle when the total number of balls in the boxes is n (and each box contains at least one ball).
Bower calls the sequence (b(n): n >= 1), the CPAL ("circular palindrome") transform of the input sequence (c(m): m >= 1). If the g.f. of the input sequence (c(m): m >= 1) is C(x) = Sum_{m>=1} c(m)*x^m, then the g.f. of the output sequence (b(n): n >= 1) is B(x) = Sum_{n >= 1} b(n)*x^n = (1 + C(x))^2/(2*(1 - C(x^2))) - 1/2.
In the current sequence, each box holds only one ball but can have one of k colors. Hence, c(1) = k but c(m) = 0 for m >= 2. Thus, C(x) = k*x. Then, for fixed k, the output sequence is (b(n): n >= 1) = (T(n, k): n >= 1), where T(n, k) = number of necklaces with n beads and k colors that are the same when turned over. If we let B_k(x) = Sum_{n>=1} T(n, k)*x^n, then B_k(x) = (1 + k*x)^2/(2*(1 - k*x^2)) - 1/2. From this, we can easily prove the formulae below.
Note that T(n, k=2) - 1 is the total number of Sommerville symmetric cyclic compositions of n. See pp. 301-304 in his paper in the links below. To see why this is the case, we use MacMahon's method of representing a cyclic composition of n with a necklace of 2 colors (see p. 273 in Sommerville's paper where the two "colors" are an x and a dot . rather than B and W). Given a Sommerville symmetrical composition b_1 + ... + b_r of n (with b_i >= 1 for all i and 1 <= r <= n), create the following circularly palindromic necklace with n beads of 2 colors: Start with a B bead somewhere on the circle and place b_1 - 1 W beads to the right of it; place a B bead to the right of the W beads (if any) followed by b_2 - 1 W beads; and so on. At the end, place a B bead followed with b_r - 1 W beads. (If b_i = 1 for some i, then a B bead follows a B bead since there are 0 W beads between them.) We thus get a circularly palindromic necklace with n beads of two colors. (The only necklace we cannot get with this method is the one than has all n beads colored W.)
It is interesting that the representation of a necklace of length n, say s_1, s_2, ..., s_n, as a periodic sequence (..., s_{-2}, s_{-1}, s_0, s_1, s_2, ...) with the property s_i = s_{i+n} for all i, as was done by Marks R. Nester in Chapter 2 of his 1999 PhD thesis, was considered by Sommerville in his 1909 paper (in the very first paragraph of his paper). (End)

Examples

			Table starts:
1  2   3    4    5     6     7      8      9     10 ...
1  3   6   10   15    21    28     36     45     55 ...
1  4   9   16   25    36    49     64     81    100 ...
1  6  18   40   75   126   196    288    405    550 ...
1  8  27   64  125   216   343    512    729   1000 ...
1 12  54  160  375   756  1372   2304   3645   5500 ...
1 16  81  256  625  1296  2401   4096   6561  10000 ...
1 24 162  640 1875  4536  9604  18432  32805  55000 ...
1 32 243 1024 3125  7776 16807  32768  59049 100000 ...
1 48 486 2560 9375 27216 67228 147456 295245 550000 ...
...
For n = 4 and k = 2, the palindromic necklaces are 0000, 0001, 0011, 0111, 0101, 1111 so T(4,2) = 6. Necklaces are only counted up to cyclic equivalence.
For n = 4 and k = 2, using MacMahon's bijection, with B = 0 and W = 1, the corresponding Sommerville symmetrical cyclic compositions of n = 4 are as follows: 1+1+1+1, 1+1+2, 1+3, 4, 2+2 (with none for 1111). If we let B = 1 and W = 0, we get the corresponding symmetrical cyclic compositions of n=4: (none for 0000) 4, 1+3, 1+1+2, 2+2, 1+1+1+1. (All these cyclic compositions must viewed on a circle.) - _Petros Hadjicostas_, Sep 02 2018
		

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for the pdf file of Chap. 2]

Crossrefs

Programs

  • Mathematica
    a[n_, k_] := If[EvenQ[n], (k^(n/2) + k^(n/2 + 1))/2, k^((n+1)/2)];
    Table[a[n-k+1, k], {n, 1, 11}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Jun 05 2017, translated from PARI *)
  • PARI
    a(n,k) = if(n % 2 == 0, (k^(n/2) + k^(n/2+1))/2, k^((n+1)/2));
    for(n=1, 10, for(k=1, 10, print1( a(n,k),", ");); print(););

Formula

T(2*n, k) = (k^(n+1) + k^n) / 2.
T(2*n + 1, k) = k^(n+1).
T(n, k) = 2 * A081720(n, k) - A075195(n, k).
From Petros Hadjicostas, Sep 02 2018: (Start)
For fixed k >= 1, the k-th column (T(n, k): n >= 1) is the CPAL ("circular palindrome") transform of the sequence k, 0, 0, ...
G.f. of column k: Sum_{n>=1} T(n,k)*x^n = (1 + k*x)^2/(2*(1 - k*x^2)) - 1/2. (End)

A245558 Square array read by antidiagonals: T(n,k) = number of n-tuples of nonnegative integers (u_0,...,u_{n-1}) satisfying Sum_{j=0..n-1} j*u_j == 1 mod n and Sum_{j=0..n-1} u_j = m.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 3, 2, 1, 1, 3, 5, 5, 3, 1, 1, 3, 7, 8, 7, 3, 1, 1, 4, 9, 14, 14, 9, 4, 1, 1, 4, 12, 20, 25, 20, 12, 4, 1, 1, 5, 15, 30, 42, 42, 30, 15, 5, 1, 1, 5, 18, 40, 66, 75, 66, 40, 18, 5, 1, 1, 6, 22, 55, 99, 132, 132, 99, 55, 22, 6, 1
Offset: 1

Views

Author

N. J. A. Sloane, Aug 07 2014

Keywords

Comments

The array is symmetric; for the entries on or below the diagonal see A245559.
If the congruence in the definition is changed from Sum_{j=0..n-1} j*u_j == 1 mod n to Sum_{j=0..n-1} j*u_j == 0 mod n we get the array shown in A241926, A047996, and A037306.
Differs from A011847 from row n = 9, k = 4 on; if the rows are surrounded by 0's, this yields A051168 without its rows 0 and 1, i.e., a(1) is A051168(2,1). - M. F. Hasler, Sep 29 2018
This array was first studied by Fredman (1975). - Petros Hadjicostas, Jul 10 2019

Examples

			Square array begins:
  1, 1,  1,  1,   1,   1,    1,    1,    1,    1, ...
  1, 1,  2,  2,   3,   3,    4,    4,    5,    5, ...
  1, 2,  3,  5,   7,   9,   12,   15,   18,   22, ...
  1, 2,  5,  8,  14,  20,   30,   40,   55,   70, ...
  1, 3,  7, 14,  25,  42,   66,   99,  143,  200, ...
  1, 3,  9, 20,  42,  75,  132,  212,  333,  497, ...
  1, 4, 12, 30,  66, 132,  245,  429,  715, 1144, ...
  1, 4, 15, 40,  99, 212,  429,  800, 1430, 2424, ...
  1, 5, 18, 55, 143, 333,  715, 1430, 2700, 4862, ...
  1, 5, 22, 70, 200, 497, 1144, 2424, 4862, 9225, ...
  ...
Reading by antidiagonals, we get:
  1;
  1, 1;
  1, 1,  1;
  1, 2,  2,  1;
  1, 2,  3,  2,  1;
  1, 3,  5,  5,  3,   1;
  1, 3,  7,  8,  7,   3,   1;
  1, 4,  9, 14, 14,   9,   4,  1;
  1, 4, 12, 20, 25,  20,  12,  4,  1;
  1, 5, 15, 30, 42,  42,  30, 15,  5,  1;
  1, 5, 18, 40, 66,  75,  66, 40, 18,  5, 1;
  1, 6, 22, 55, 99, 132, 132, 99, 55, 22, 6, 1;
  ...
		

Crossrefs

This array is very similar to but different from A011847.
Rows include A001840, A006918, A051170, A011796, A011797, A031164. Main diagonal is A022553.

Programs

  • Maple
    # To produce the first 10 rows and columns (as on page 174 of the Elashvili et al. 1999 reference):
    with(numtheory):
    cnk:=(n,k) -> add(mobius(n/d)*d, d in divisors(gcd(n,k)));
    anmk:=(n,m,k)->(1/(n+m))*add( cnk(d,k)*binomial((n+m)/d,n/d), d in divisors(gcd(n,m))); # anmk(n,m,k) is the value of a_k(n,m) as in Theorem 1, Equation (4), of the Elashvili et al. 1999 reference.
    r2:=(n,k)->[seq(anmk(n,m,k),m=1..10)];
    for n from 1 to 10 do lprint(r2(n,1)); od:
  • Mathematica
    rows = 12;
    cnk[n_, k_] := Sum[MoebiusMu[n/d] d, {d , Divisors[GCD[n, k]]}];
    anmk[n_, m_, k_] := (1/(n+m)) Sum[cnk[d, k] Binomial[(n+m)/d, n/d], {d, Divisors[GCD[n, m]]}];
    r2[n_, k_] := Table[anmk[n, m, k], {m, 1, rows}];
    T = Table[r2[n, 1], {n, 1, rows}];
    Table[T[[n-k+1, k]], {n, 1, rows}, {k, 1, n}] // Flatten (* Jean-François Alcover, Nov 05 2018, from Maple *)

A267632 Triangle T(n, k) read by rows: the k-th column of the n-th row lists the number of ways to select k distinct numbers (k >= 1) from [1..n] so that their sum is divisible by n.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 2, 2, 1, 1, 1, 2, 4, 3, 1, 0, 1, 3, 5, 5, 3, 1, 1, 1, 3, 7, 9, 7, 3, 1, 0, 1, 4, 10, 14, 14, 10, 4, 1, 1, 1, 4, 12, 22, 26, 20, 12, 5, 1, 0, 1, 5, 15, 30, 42, 42, 30, 15, 5, 1, 1, 1, 5, 19, 42, 66, 76, 66, 43, 19, 5, 1, 0
Offset: 1

Views

Author

Dimitri Papadopoulos, Jan 18 2016

Keywords

Comments

Row less the last element is palindrome for n=odd or n=power of 2 where n is the row number (observation-conjecture).
From Petros Hadjicostas, Jul 13 2019: (Start)
By reading carefully the proof of Lemma 5.1 (pp. 65-66) in Barnes (1959), we see that he actually proved a general result (even though he does not state it in the lemma).
According to the definition of this sequence, for 1 <= k <= n, T(n, k) is the number of unordered sets b_1, b_2, ..., b_k of k distinct integers from 1..n such that b_1 + b_2 + ... + b_k = 0 (mod n). The proof of Lemma 5.1 in Barnes (1959) implies that T(n, k) = (1/n) * Sum_{s | gcd(n, k)} (-1)^(k - (k/s)) * phi(s) * binomial(n/s, k/s) for 1 <= k <= n.
For fixed k >= 1, the g.f. of the column (T(n, k): n >= 1) (with T(n, k) = 0 for 1 <= n < k) is (x^k/k) * Sum_{s|k} phi(s) * (-1)^(k - (k/s)) / (1 - x^s)^(k/s), which generalizes Herbert Kociemba's formula from A032801.
Barnes' (1959) formula is a special case of Theorem 4 (p. 66) in Ramanathan (1944). If R(n, k, v) is the number of unordered sets b_1, b_2, ..., b_k of k distinct integers from 1..n such that b_1 + b_2 + ... + b_k = v (mod n), then he proved that R(n, k, v) = (1/n) * Sum_{s | gcd(n,k)} (-1)^(k - (k/s)) * binomial(n/s, k/s) * C_s(v), where C_s(v) = A054535(s, v) = Sum_{d | gcd(s,v)} d * Moebius(s/d) is Ramanujan's sum (even though it was first discovered around 1900 by the Austrian mathematician R. D. von Sterneck).
Because C_s(v = 0) = phi(s), we get Barnes' (implicit) result; i.e., R(n, k, v=0) = T(n, k) for 1 <= k <= n.
For k=2, we have R(n, k=2, v=0) = T(n, k=2) = A004526(n-1) for n >= 1. For k=3, we have R(n, k=3, v=0) = T(n, k=3) = A058212(n) for n >= 1. For k=4, we have R(n, k=4, v=0) = A032801(n) for n >= 1. For k=5, we have R(n, k=5, v=0) = T(n, k=5) = A008646(n-5) for n >= 5.
The reason we have T(2*m+1, k) = A037306(2*m+1, k) = A047996(2*m+1, k) for m >= 0 and k >= 1 is the following. When n = 2*m + 1, all divisors s of gcd(n, k) are odd. In such a case, k - (k/s) is even for all k >= 1, and thus (-1)^(k - (k/s)) = 1, and thus T(n = 2*m+1, k) = (1/n) * Sum_{s | gcd(n, k)} phi(s) * binomial(n/s, k/s) = A037306(2*m+1, k) = A047996(2*m+1, k).
By summing the products of the g.f. of column k times y^k from k = 1 to k = infinity, we get the bivariate g.f. for the array: Sum_{n, k >= 1} T(n, k)*x^n*y^k = Sum_{s >= 1} (phi(s)/s) * log((1 - x^s + (-x*y)^s)/(1 - x^s)) = -x/(1 - x) - Sum_{s >= 1} (phi(s)/s) * log(1 - x^s + (-x*y)^s).
Letting y = 1 in the above bivariate g.f., we get the g.f. of the sequence (Sum_{1 <= k <= n} T(n, k): n >= 1) is -x/(1 - x) - Sum_{s >= 1} (phi(s)/s) * log(1 - x^s + (-x)^s) = -x/(1 - x) + Sum_{m >= 0} (phi(2*m + 1)/(2*m + 1)) * log(1 - 2*x^(2*m+1)), which is the g.f. of sequence A082550. Hence, sequence A082550 consists of the row sums.
There is another important interpretation of this array T(n, k) which is related to some of the references for sequence A047996, but because the discussion is too lengthy, we omit the details.
(End)

Examples

			For n = 5, there is one way to pick one number (5), two ways to pick two numbers (1+4, 2+3), two ways to pick 3 numbers (1+4+5, 2+3+5), one way to pick 4 numbers (1+2+3+4), and one way to pick 5 numbers (1+2+3+4+5) so that their sum is divisible by 5. Therefore, T(5,1) = 1, T(5,2) = 2, T(5,3) = 2, T(5,4) = 1, and T(5,5) = 1.
Table for T(n,k) begins as follows:
n\k 1 2   3    4    5    6    7    8    9   10
1   1
2   1 0
3   1 1   1
4   1 1   1    0
5   1 2   2    1    1
6   1 2   4    3    1    0
7   1 3   5    5    3    1    1
8   1 3   7    9    7    3    1    0
9   1 4  10   14   14   10    4    1    1
10  1 4  12   22   26   20   12    5    1    0
...
		

Crossrefs

Programs

  • Maple
    A267632 := proc(n,k)
        local a,msel,p;
        a := 0 ;
        for msel in combinat[choose](n,k) do
            if modp(add(p,p=msel),n) = 0 then
                a := a+1 ;
            end if;
        end do:
        a;
    end proc: # R. J. Mathar, May 15 2016
    # second Maple program:
    b:= proc(n, m, s) option remember; expand(`if`(n=0,
          `if`(s=0, 1, 0), b(n-1, m, s)+x*b(n-1, m, irem(s+n, m))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n$2, 0)):
    seq(T(n), n=1..14);  # Alois P. Heinz, Aug 27 2018
  • Mathematica
    f[k_, n_] :=  Length[Select[Select[Subsets[Range[n]], Length[#] == k &], IntegerQ[Total[#]/n] &]];MatrixForm[Table[{n, Table[f[k, n], {k, n}]}, {n, 10}]] (* Dimitri Papadopoulos, Jan 18 2016 *)

Formula

T(2n+1, k) = A037306(2n+1, k) = A047996(2n+1, k).
From Petros Hadjicostas, Jul 13 2019: (Start)
T(n, k) = (1/n) * Sum_{s | gcd(n, k)} (-1)^(k - (k/s)) * phi(s) * binomial(n/s, k/s) for 1 <= k <= n.
G.f. for column k >= 1: (x^k/k) * Sum_{s|k} phi(s) * (-1)^(k - (k/s)) / (1 - x^s)^(k/s).
Bivariate g.f.: Sum_{n, k >= 1} T(n, k)*x^n*y^k = -x/(1 - x) - Sum_{s >= 1} (phi(s)/s) * log(1 - x^s + (-x*y)^s).
(End)
Sum_{k=1..n} k * T(n,k) = A309122(n). - Alois P. Heinz, Jul 13 2019

A178574 a(n) = 2*n*(9*n-1).

Original entry on oeis.org

16, 68, 156, 280, 440, 636, 868, 1136, 1440, 1780, 2156, 2568, 3016, 3500, 4020, 4576, 5168, 5796, 6460, 7160, 7896, 8668, 9476, 10320, 11200, 12116, 13068, 14056, 15080, 16140, 17236, 18368, 19536, 20740, 21980, 23256, 24568, 25916, 27300, 28720, 30176, 31668, 33196, 34760, 36360
Offset: 1

Views

Author

Paul Weisenhorn, Dec 24 2010

Keywords

Comments

Numbers with ordered partitions that have periods of length 6.
From each ordered partition of the numbers (15+j) with 0
The a(n) sequence begins with 16 and each member has 1 period; the b(n) sequence begins with 17 and each member has 2 periods; the c(n) sequence begins with 18 and each member has 3 periods; the d(n) sequence begins with 19 and each member has 2 periods; the e(n) sequence begins with 20 and each member has 1 period of length 6

Examples

			a(5) = 5*(18*5-2) = 440; b(5) = a(5) + 5 = 445; c(5) = a(5)*2*5 = 450; d(5) = a(5) + 3*5 = 455; e(5) = a(5) + 4*5 = 460.
		

Crossrefs

Programs

Formula

G.f. for a(n): (16 + 20*x)/(1-x)^3.
for b(n): (17 + 19*x)/(1-x)^3.
for c(n): (18 + 18*x)/(1-x)^3.
for d(n): (19 + 17*x)/(1-x)^3.
for e(n): (20 + 16*x)/(1-x)^3.
all sequences have the same recurrence:
s(n+3) = 3*s(n+2) - 3*s(n+1) + s(n);
with s(0) = 0, s(1) = 15 + j, s(2) = 66 + 2*j and 0
a(n) = n*(18*n-2) = 4*A022266(n).
b(n) = n*(18*n-1) = a(n) + n.
c(n) = 18*n^2 = a(n) + 2*n.
d(n) = n*(18*n+1) = a(n) + 3*n.
e(n) = n*(18*n+2) = a(n) + 4*n.
The general formula for numbers with periods of length k: a(k,j,n) = n*(k^2*n - k + 2*j)/2 and 0
For j=1 and j=(k-1) the numbers have 1 period.
For 1A092964(k-4,j-1) periods.
G.f. (binomial(k,2)*(1+x) + j + (k-j)*x)/(1-x)^3.
E.g.f.: 2*exp(x)*x*(8 + 9*x). - Elmo R. Oliveira, Jan 28 2025
Showing 1-10 of 17 results. Next