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

A000740 Number of 2n-bead balanced binary necklaces of fundamental period 2n, equivalent to reversed complement; also Dirichlet convolution of b_n=2^(n-1) with mu(n); also number of components of Mandelbrot set corresponding to Julia sets with an attractive n-cycle.

Original entry on oeis.org

1, 1, 3, 6, 15, 27, 63, 120, 252, 495, 1023, 2010, 4095, 8127, 16365, 32640, 65535, 130788, 262143, 523770, 1048509, 2096127, 4194303, 8386440, 16777200, 33550335, 67108608, 134209530, 268435455, 536854005, 1073741823, 2147450880
Offset: 1

Views

Author

Keywords

Comments

Also number of compositions of n into relatively prime parts (that is, the gcd of all the parts is 1). Also number of subsets of {1,2,..,n} containing n and consisting of relatively prime numbers. - Vladeta Jovovic, Aug 13 2003
Also number of perfect parity patterns that have exactly n columns (see A118141). - Don Knuth, May 11 2006
a(n) is odd if and only if n is squarefree (Tim Keller). - Emeric Deutsch, Apr 27 2007
a(n) is a multiple of 3 for all n>=3 (see Problem 11161 link). - Emeric Deutsch, Aug 13 2008
Row sums of triangle A143424. - Gary W. Adamson, Aug 14 2008
a(n) is the number of monic irreducible polynomials with nonzero constant coefficient in GF(2)[x] of degree n. - Michel Marcus, Oct 30 2016
a(n) is the number of aperiodic compositions of n, the number of compositions of n with relatively prime parts, and the number of compositions of n with relatively prime run-lengths. - Gus Wiseman, Dec 21 2017

Examples

			For n=4, there are 6 compositions of n into coprime parts: <3,1>, <2,1,1>, <1,3>, <1,2,1>, <1,1,2>, and <1,1,1,1>.
From _Gus Wiseman_, Dec 19 2017: (Start)
The a(6) = 27 aperiodic compositions are:
  (11112), (11121), (11211), (12111), (21111),
  (1113), (1122), (1131), (1221), (1311), (2112), (2211), (3111),
  (114), (123), (132), (141), (213), (231), (312), (321), (411),
  (15), (24), (42), (51),
  (6).
The a(6) = 27 compositions into relatively prime parts are:
  (111111),
  (11112), (11121), (11211), (12111), (21111),
  (1113), (1122), (1131), (1212), (1221), (1311), (2112), (2121), (2211), (3111),
  (114), (123), (132), (141), (213), (231), (312), (321), (411),
  (15), (51).
The a(6) = 27 compositions with relatively prime run-lengths are:
  (11112), (11121), (11211), (12111), (21111),
  (1113), (1131), (1212), (1221), (1311), (2112), (2121), (3111),
  (114), (123), (132), (141), (213), (231), (312), (321), (411),
  (15), (24), (42), (51),
  (6).
(End)
		

References

  • H. O. Peitgen and P. H. Richter, The Beauty of Fractals, Springer-Verlag; contribution by A. Douady, p. 165.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Equals A027375/2.
See A056278 for a variant.
First differences of A085945.
Column k=2 of A143325.
Row sums of A101391.

Programs

  • Maple
    with(numtheory): a[1]:=1: a[2]:=1: for n from 3 to 32 do div:=divisors(n): a[n]:=2^(n-1)-sum(a[n/div[j]],j=2..tau(n)) od: seq(a[n],n=1..32); # Emeric Deutsch, Apr 27 2007
    with(numtheory); A000740:=n-> add(mobius(n/d)*2^(d-1), d in divisors(n)); # N. J. A. Sloane, Oct 18 2012
  • Mathematica
    a[n_] := Sum[ MoebiusMu[n/d]*2^(d - 1), {d, Divisors[n]}]; Table[a[n], {n, 1, 32}] (* Jean-François Alcover, Feb 03 2012, after PARI *)
  • PARI
    a(n) = sumdiv(n,d,moebius(n/d)*2^(d-1))
    
  • Python
    from sympy import mobius, divisors
    def a(n): return sum([mobius(n // d) * 2**(d - 1) for d in divisors(n)])
    [a(n) for n in range(1, 101)]  # Indranil Ghosh, Jun 28 2017

Formula

a(n) = Sum_{d|n} mu(n/d)*2^(d-1), Mobius transform of A011782. Furthermore, Sum_{d|n} a(d) = 2^(n-1).
a(n) = A027375(n)/2 = A038199(n)/2.
a(n) = Sum_{k=0..n} A051168(n,k)*k. - Max Alekseyev, Apr 09 2013
Recurrence relation: a(n) = 2^(n-1) - Sum_{d|n,d>1} a(n/d). (Lafayette College Problem Group; see the Maple program and Iglesias eq (6)). - Emeric Deutsch, Apr 27 2007
G.f.: Sum_{k>=1} mu(k)*x^k/(1 - 2*x^k). - Ilya Gutkovskiy, Oct 24 2018
G.f. satisfies Sum_{n>=1} A( (x/(1 + 2*x))^n ) = x. - Paul D. Hanna, Apr 02 2025

Extensions

Connection with Mandelbrot set discovered by Warren D. Smith and proved by Robert Munafo, Feb 06 2000
Ambiguous term a(0) removed by Max Alekseyev, Jan 02 2012

A143324 Table T(n,k) by antidiagonals. T(n,k) is the number of length n primitive (=aperiodic or period n) k-ary words (n,k >= 1).

Original entry on oeis.org

1, 2, 0, 3, 2, 0, 4, 6, 6, 0, 5, 12, 24, 12, 0, 6, 20, 60, 72, 30, 0, 7, 30, 120, 240, 240, 54, 0, 8, 42, 210, 600, 1020, 696, 126, 0, 9, 56, 336, 1260, 3120, 4020, 2184, 240, 0, 10, 72, 504, 2352, 7770, 15480, 16380, 6480, 504, 0, 11, 90, 720, 4032, 16800, 46410, 78120, 65280, 19656, 990, 0
Offset: 1

Views

Author

Alois P. Heinz, Aug 07 2008

Keywords

Comments

Column k is Dirichlet convolution of mu(n) with k^n.
The coefficients of the polynomial of row n are given by the n-th row of triangle A054525; for example row 4 has polynomial -k^2+k^4.

Examples

			T(2,3)=6, because there are 6 primitive words of length 2 over 3-letter alphabet {a,b,c}: ab, ac, ba, bc, ca, cb; note that the non-primitive words aa, bb and cc don't belong to the list; secondly note that the words in the list need not be Lyndon words, for example ba can be derived from ab by a cyclic rotation of the positions.
Table begins:
  1,  2,   3,    4,    5, ...
  0,  2,   6,   12,   20, ...
  0,  6,  24,   60,  120, ...
  0, 12,  72,  240,  600, ...
  0, 30, 240, 1020, 3120, ...
		

Crossrefs

Rows n=1-10 give: A000027, A002378(k-1), A007531(k+1), A047928(k+1), A061167, A218130, A133499, A218131, A218132, A218133.
Main diagonal gives A252764.

Programs

  • Maple
    with(numtheory): f0:= proc(n) option remember; unapply(k^n-add(f0(d)(k), d=divisors(n)minus{n}), k) end; T:= (n,k)-> f0(n)(k); seq(seq(T(n, 1+d-n), n=1..d), d=1..12);
  • Mathematica
    f0[n_] := f0[n] = Function [k, k^n - Sum[f0[d][k], {d, Complement[Divisors[n], {n}]}]]; t[n_, k_] := f0[n][k]; Table[Table[t[n, 1 + d - n], {n, 1, d}], {d, 1, 12}] // Flatten (* Jean-François Alcover, Dec 12 2013, translated from Maple *)

Formula

T(n,k) = Sum_{d|n} k^d * mu(n/d).
T(n,k) = k^n - Sum_{d
T(n,k) = A143325(n,k) * k.
T(n,k) = A074650(n,k) * n.
So Sum_{d|n} k^d * mu(n/d) == 0 (mod n), this is a generalization of Fermat's little theorem k^p - k == 0 (mod p) for primes p to an arbitrary modulus n (see the Smyth link). - Franz Vrabec, Feb 09 2021

A143327 Table T(n,k) by antidiagonals. T(n,k) is the number of primitive (=aperiodic) k-ary words (n,k >= 1) with length less than or equal to n which are earlier in lexicographic order than any other word derived by cyclic shifts of the alphabet.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 5, 1, 1, 4, 11, 11, 1, 1, 5, 19, 35, 26, 1, 1, 6, 29, 79, 115, 53, 1, 1, 7, 41, 149, 334, 347, 116, 1, 1, 8, 55, 251, 773, 1339, 1075, 236, 1, 1, 9, 71, 391, 1546, 3869, 5434, 3235, 488, 1, 1, 10, 89, 575, 2791, 9281, 19493, 21754, 9787, 983, 1, 1, 11
Offset: 1

Author

Alois P. Heinz, Aug 07 2008

Keywords

Comments

The coefficients of the polynomial of row n are given by the n-th row of triangle A134541; for example row 4 has polynomial -1+k^2+k^3.

Examples

			T(3,3) = 11, because 11 words of length <=3 over 3-letter alphabet {a,b,c} are primitive and earlier than others derived by cyclic shifts of the alphabet: a, ab, ac, aab, aac, aba, abb, abc, aca, acb, acc.
Table begins:
  1,   1,    1,     1,     1,      1,      1,       1, ...
  1,   2,    3,     4,     5,      6,      7,       8, ...
  1,   5,   11,    19,    29,     41,     55,      71, ...
  1,  11,   35,    79,   149,    251,    391,     575, ...
  1,  26,  115,   334,   773,   1546,   2791,    4670, ...
  1,  53,  347,  1339,  3869,   9281,  19543,   37367, ...
  1, 116, 1075,  5434, 19493,  55936, 137191,  299510, ...
  1, 236, 3235, 21754, 97493, 335656, 960391, 2396150, ...
		

Crossrefs

Rows n=1-4 give: A000012, A000027, A028387, A003777.
Main diagonal gives A320095.

Programs

  • Maple
    with(numtheory):
    f1:= proc (n) option remember; unapply(k^(n-1)
            -add(f1(d)(k), d=divisors(n) minus {n}), k)
         end:
    g1:= proc(n) option remember; unapply(add(f1(j)(x), j=1..n), x) end:
    T:= (n, k)-> g1(n)(k):
    seq(seq(T(n, 1+d-n), n=1..d), d=1..12);
  • Mathematica
    t[n_, k_] := Sum[k^(d-1)*MoebiusMu[j/d], {j, 1, n}, {d, Divisors[j]}]; Table[t[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 13 2013 *)

Formula

T(n,k) = Sum_{j=1..n} Sum_{d|j} k^(d-1) * mu(j/d).
T(n,k) = Sum_{j=1..n} A143325(j,k).
T(n,k) = A143326(n,k) / k.

A075147 Number of Lyndon words (aperiodic necklaces) with n beads of n colors.

Original entry on oeis.org

1, 1, 8, 60, 624, 7735, 117648, 2096640, 43046640, 999989991, 25937424600, 743008120140, 23298085122480, 793714765724595, 29192926025339776, 1152921504338411520, 48661191875666868480, 2185911559727674682148, 104127350297911241532840, 5242879999999487999992020
Offset: 1

Author

Christian G. Bower, Sep 04 2002

Keywords

Crossrefs

Main diagonal of A074650 and A143325.

Programs

  • Maple
    with(numtheory):
    a:= n-> add(n^d *mobius(n/d), d=divisors(n))/n:
    seq(a(n), n=1..25);  # Alois P. Heinz, Dec 21 2014
  • Mathematica
    Table[Total@Map[ MoebiusMu[#1] n^(n/#1 - 1) &, Divisors[n]], {n, 20}] (* Olivier Gérard, Aug 05 2016 *)
  • PARI
    a(n) = sumdiv(n, d, moebius(n/d) * n^d) / n; \\ Amiram Eldar, May 29 2025

Formula

a(n) = (1/n) * Sum_{d|n} mu(n/d)*n^d.
Asymptotic to n^(n-1) = A000169(n).
a(n) is the n-th term of the inverse Euler transform of j-> n^j. - Alois P. Heinz, Jun 23 2018
a(n) = [x^n] Sum_{k>=1} mu(k)*log(1/(1 - n*x^k))/k. - Ilya Gutkovskiy, May 20 2019

A034741 Dirichlet convolution of mu(n) with 3^(n-1).

Original entry on oeis.org

1, 2, 8, 24, 80, 232, 728, 2160, 6552, 19600, 59048, 176880, 531440, 1593592, 4782880, 14346720, 43046720, 129133368, 387420488, 1162241760, 3486783664, 10460294152, 31381059608, 94142999520, 282429536400, 847288078000, 2541865821768, 7625595890640, 22876792454960
Offset: 1

Keywords

Crossrefs

Column k=3 of A143325.
First differences of A320087.
Cf. A054718.

Programs

  • Mathematica
    nmax = 20; Rest[CoefficientList[Series[Sum[MoebiusMu[k] * x^k / (1 - 3*x^k), {k, 1, nmax}], {x, 0, nmax}], x]] (* Vaclav Kotesovec, Dec 11 2020 *)
  • PARI
    a(n) = sumdiv(n,d, moebius(d) * 3^(n/d-1) ); \\ Joerg Arndt, Apr 14 2013

Formula

G.f.: Sum_{k>=1} mu(k)*x^k/(1 - 3*x^k). - Ilya Gutkovskiy, Oct 25 2018
a(n) ~ 3^(n-1). - Vaclav Kotesovec, Sep 11 2019

A295505 a(n) = Sum_{d|n} mu(n/d)*4^(d-1).

Original entry on oeis.org

1, 3, 15, 60, 255, 1005, 4095, 16320, 65520, 261885, 1048575, 4193220, 16777215, 67104765, 268435185, 1073725440, 4294967295, 17179802640, 68719476735, 274877644740, 1099511623665, 4398045462525, 17592186044415, 70368739967040, 281474976710400
Offset: 1

Author

Seiichi Manyama, Nov 23 2017

Keywords

Crossrefs

Sum_{d|n} mu(n/d)*k^(d-1): A000740 (k=2), A034741 (k=3), this sequence (k=4), A295506 (k=5).
Column k=4 of A143325.
First differences of A320088.
Cf. A054719.

Programs

  • Mathematica
    Table[Sum[MoebiusMu[n/d]4^(d-1),{d,Divisors[n]}],{n,30}] (* Harvey P. Dale, Nov 08 2020 *)
    nmax = 20; Rest[CoefficientList[Series[Sum[MoebiusMu[k] * x^k / (1 - 4*x^k), {k, 1, nmax}], {x, 0, nmax}], x]] (* Vaclav Kotesovec, Dec 11 2020 *)
  • PARI
    {a(n) = sumdiv(n, d, moebius(n/d)*4^(d-1))}

Formula

a(n) = A054719(n)/4 for n > 0.
G.f.: Sum_{k>=1} mu(k)*x^k/(1 - 4*x^k). - Ilya Gutkovskiy, Oct 25 2018

A295506 a(n) = Sum_{d|n} mu(n/d)*5^(d-1).

Original entry on oeis.org

1, 4, 24, 120, 624, 3096, 15624, 78000, 390600, 1952496, 9765624, 48824880, 244140624, 1220687496, 6103514976, 30517500000, 152587890624, 762939059400, 3814697265624, 19073484374880, 95367431624976, 476837148437496, 2384185791015624, 11920928906172000
Offset: 1

Author

Seiichi Manyama, Nov 23 2017

Keywords

Crossrefs

Sum_{d|n} mu(n/d)*k^(d-1): A000740 (k=2), A034741 (k=3), A295505 (k=4), this sequence (k=5).
Column k=5 of A143325.
First differences of A320089.
Cf. A054720.

Programs

  • Mathematica
    nmax = 20; Rest[CoefficientList[Series[Sum[MoebiusMu[k] * x^k / (1 - 5*x^k), {k, 1, nmax}], {x, 0, nmax}], x]] (* Vaclav Kotesovec, Dec 11 2020 *)
  • PARI
    {a(n) = sumdiv(n, d, moebius(n/d)*5^(d-1))}

Formula

a(n) = A054720(n)/5 for n > 0.
G.f.: Sum_{k>=1} mu(k)*x^k/(1 - 5*x^k). - Ilya Gutkovskiy, Oct 25 2018

A252764 Number of length n primitive (=aperiodic or period n) n-ary words.

Original entry on oeis.org

1, 2, 24, 240, 3120, 46410, 823536, 16773120, 387419760, 9999899910, 285311670600, 8916097441680, 302875106592240, 11112006720144330, 437893890380096640, 18446744069414584320, 827240261886336764160, 39346408075098144278664, 1978419655660313589123960
Offset: 1

Author

Alois P. Heinz, Dec 21 2014

Keywords

Examples

			a(3) = 24 because there are 24 primitive words of length 3 over 3-letter alphabet {a,b,c}: aab, aac, aba, abb, abc, aca, acb, acc, baa, bab, bac, bba, bbc, bca, bcb, bcc, caa, cab, cac, cba, cbb, cbc, cca, ccb.
		

Crossrefs

Main diagonal of A143324.

Programs

  • Maple
    with(numtheory):
    a:= n-> add(n^d *mobius(n/d), d=divisors(n)):
    seq(a(n), n=1..25);
  • Mathematica
    a[n_] := DivisorSum[n, n^# * MoebiusMu[n/#]& ];
    Array[a, 25] (* Jean-François Alcover, Mar 24 2017, translated from Maple *)

Formula

a(n) = Sum_{d|n} n^d * mu(n/d), mu = A008683.
a(n) = A075147(n)*n.
a(n) = A074650(n,n) * n.
a(n) = A143325(n,n) * n.
a(n) = A143324(n,n).

A320071 Number of length n primitive (=aperiodic or period n) 6-ary words which are earlier in lexicographic order than any other word derived by cyclic shifts of the alphabet.

Original entry on oeis.org

1, 5, 35, 210, 1295, 7735, 46655, 279720, 1679580, 10076395, 60466175, 362789070, 2176782335, 13060647355, 78364162765, 470184704640, 2821109907455, 16926657757380, 101559956668415, 609359729932590, 3656158440016285, 21936950579911675, 131621703842267135
Offset: 1

Author

Alois P. Heinz, Oct 05 2018

Keywords

Comments

Dirichlet convolution of mu(n) with 6^(n-1).

Crossrefs

Column k=6 of A143325.
First differences of A320090.

Programs

  • Maple
    a:= n-> add(`if`(d=n, 6^(n-1), -a(d)), d=numtheory[divisors](n)):
    seq(a(n), n=1..25);
  • Mathematica
    nmax = 20; Rest[CoefficientList[Series[Sum[MoebiusMu[k] * x^k / (1 - 6*x^k), {k, 1, nmax}], {x, 0, nmax}], x]] (* Vaclav Kotesovec, Dec 11 2020 *)

Formula

a(n) = Sum_{d|n} 6^(d-1) * mu(n/d).
a(n) = 6^(n-1) - Sum_{d
a(n) = A143325(n,6).
a(n) = A074650(n,6) * n/6.
a(n) = A143324(n,6) / 6.
G.f.: Sum_{k>=1} mu(k)*x^k/(1 - 6*x^k). - Ilya Gutkovskiy, Oct 25 2018

A320072 Number of length n primitive (=aperiodic or period n) 7-ary words which are earlier in lexicographic order than any other word derived by cyclic shifts of the alphabet.

Original entry on oeis.org

1, 6, 48, 336, 2400, 16752, 117648, 823200, 5764752, 40351200, 282475248, 1977309600, 13841287200, 96888892752, 678223070400, 4747560686400, 33232930569600, 232630508205648, 1628413597910448, 11398895145019200, 79792266297494304, 558545863800808752
Offset: 1

Author

Alois P. Heinz, Oct 05 2018

Keywords

Comments

Dirichlet convolution of mu(n) with 7^(n-1).

Crossrefs

Column k=7 of A143325.
First differences of A320091.

Programs

  • Maple
    a:= n-> add(`if`(d=n, 7^(n-1), -a(d)), d=numtheory[divisors](n)):
    seq(a(n), n=1..25);

Formula

a(n) = Sum_{d|n} 7^(d-1) * mu(n/d).
a(n) = 7^(n-1) - Sum_{d
a(n) = A143325(n,7).
a(n) = A074650(n,7) * n/7.
a(n) = A143324(n,7) / 7.
G.f.: Sum_{k>=1} mu(k)*x^k/(1 - 7*x^k). - Ilya Gutkovskiy, Oct 25 2018
Showing 1-10 of 23 results. Next