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-5 of 5 results.

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

A027375 Number of aperiodic binary strings of length n; also number of binary sequences with primitive period n.

Original entry on oeis.org

0, 2, 2, 6, 12, 30, 54, 126, 240, 504, 990, 2046, 4020, 8190, 16254, 32730, 65280, 131070, 261576, 524286, 1047540, 2097018, 4192254, 8388606, 16772880, 33554400, 67100670, 134217216, 268419060, 536870910, 1073708010, 2147483646, 4294901760
Offset: 0

Views

Author

Keywords

Comments

A sequence S is aperiodic if it is not of the form S = T^k with k>1. - N. J. A. Sloane, Oct 26 2012
Equivalently, number of output sequences with primitive period n from a simple cycling shift register. - Frank Ruskey, Jan 17 2000
Also, the number of nonempty subsets A of the set of the integers 1 to n such that gcd(A) is relatively prime to n (for n>1). - R. J. Mathar, Aug 13 2006; range corrected by Geoffrey Critzer, Dec 07 2014
Without the first term, this sequence is the Moebius transform of 2^n (n>0). For n > 0, a(n) is also the number of periodic points of period n of the transform associated to the Kolakoski sequence A000002. This transform changes a sequence of 1's and 2's by the sequence of the lengths of its runs. The Kolakoski sequence is one of the two fixed points of this transform, the other being the same sequence without the initial term. A025142 and A025143 are the 2 periodic points of period 2. A001037(n) = a(n)/n gives the number of orbits of size n. - Jean-Christophe Hervé, Oct 25 2014
From Bernard Schott, Jun 19 2019: (Start)
There are 2^n strings of length n that can be formed from the symbols 0 and 1; in the example below with a(3) = 6, the last two strings that are not aperiodic binary strings are { 000, 111 }, corresponding to 0^3 and 1^3, using the notation of the first comment.
Two properties mentioned by Krusemeyer et al. are:
1) For any n > 2, a(n) is divisible by 6.
2) Lim_{n->oo} a(n+1)/a(n) = 2. (End)

Examples

			a(3) = 6 = |{ 001, 010, 011, 100, 101, 110 }|. - corrected by _Geoffrey Critzer_, Dec 07 2014
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 13. - From N. J. A. Sloane, Oct 26 2012
  • E. R. Berlekamp, Algebraic Coding Theory, McGraw-Hill, NY, 1968, p. 84.
  • Blanchet-Sadri, Francine. Algorithmic combinatorics on partial words. Chapman & Hall/CRC, Boca Raton, FL, 2008. ii+385 pp. ISBN: 978-1-4200-6092-8; 1-4200-6092-9 MR2384993 (2009f:68142). See p. 164.
  • S. W. Golomb, Shift-Register Sequences, Holden-Day, San Francisco, 1967.
  • Mark I. Krusemeyer, George T. Gilbert, Loren C. Larson, A Mathematical Orchard, Problems and Solutions, MAA, 2012, Problem 128, pp. 225-227.

Crossrefs

A038199 and A056267 are essentially the same sequence with different initial terms.
Column k=2 of A143324.

Programs

  • Haskell
    a027375 n = n * a001037 n  -- Reinhard Zumkeller, Feb 01 2013
    
  • Maple
    with(numtheory): A027375 :=n->add( mobius(d)*2^(n/d), d = divisors(n)); # N. J. A. Sloane, Sep 25 2012
  • Mathematica
    Table[ Apply[ Plus, MoebiusMu[ n / Divisors[n] ]*2^Divisors[n] ], {n, 1, 32} ]
    a[0]=0; a[n_] := DivisorSum[n, MoebiusMu[n/#]*2^#&]; Array[a, 40, 0] (* Jean-François Alcover, Dec 01 2015 *)
  • PARI
    a(n) = sumdiv(n,d,moebius(n\d)*2^d);
    
  • Python
    from sympy import mobius, divisors
    def a(n): return sum(mobius(d)*2**(n//d) for d in divisors(n))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 28 2017

Formula

a(n) = Sum_{d|n} mu(d)*2^(n/d).
a(n) = 2*A000740(n).
a(n) = n*A001037(n).
Sum_{d|n} a(n) = 2^n.
a(p) = 2^p - 2 for p prime. - R. J. Mathar, Aug 13 2006
a(n) = 2^n - O(2^(n/2)). - Charles R Greathouse IV, Apr 28 2016
a(n) = 2^n - A152061(n). - Bernard Schott, Jun 20 2019
G.f.: 2 * Sum_{k>=1} mu(k)*x^k/(1 - 2*x^k). - Ilya Gutkovskiy, Nov 11 2019

A038199 Row sums of triangle T(m,n) = number of solutions to 1 <= a(1) < a(2) < ... < a(m) <= n, where gcd(a(1), a(2), ..., a(m), n) = 1, in A020921.

Original entry on oeis.org

1, 2, 6, 12, 30, 54, 126, 240, 504, 990, 2046, 4020, 8190, 16254, 32730, 65280, 131070, 261576, 524286, 1047540, 2097018, 4192254, 8388606, 16772880, 33554400, 67100670, 134217216, 268419060, 536870910, 1073708010, 2147483646
Offset: 1

Views

Author

Temba Shonhiwa (Temba(AT)maths.uz.ac.zw)

Keywords

Comments

The function T(m,n) described above has an inverse: see A038200.
Also, Moebius transform of 2^n - 1 = A000225. Also, number of rationals in [0, 1) whose binary expansions consist just of repeating bits of (least) period exactly n (i.e., there's no preperiodic part), where 0 = 0.000... is considered to have period 1. - Brad Chalfan (brad(AT)chalfan.net), May 29 2006

Crossrefs

A027375, A038199 and A056267 are all essentially the same sequence with different initial terms.
Cf. A059966 (a(n)/n).

Programs

  • Haskell
    a038199 n = sum [a008683 (n `div` d) * (a000225 d)| d <- a027750_row n]
    -- Reinhard Zumkeller, Feb 17 2013
    
  • Mathematica
    Table[Plus@@((2^Divisors[n]-1)MoebiusMu[n/Divisors[n]]),{n,1,31}] (* Brad Chalfan (brad(AT)chalfan.net), May 29 2006 *)
  • PARI
    a(n) = sumdiv(n, d, moebius(n/d)*(2^d-1)); \\ Michel Marcus, Jun 28 2017
  • Python
    from sympy import mobius, divisors
    def a(n): return sum(mobius(n//d) * (2**d - 1) for d in divisors(n))
    print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Jun 28 2017
    

Formula

a(n) = Sum_{d | n} mu(n/d)*(2^d-1). - Paul Barry, Mar 20 2005
Lambert g.f.: Sum_{n>=1} a(n)*x^n/(1 - x^n) = x/((1 - x)*(1 - 2*x)). - Ilya Gutkovskiy, Apr 25 2017
O.g.f.: Sum_{d >= 1} mu(d)*x^d/((1 - x^d)*(1 - 2*x^d)). - Petros Hadjicostas, Jun 18 2019

Extensions

Better description from Michael Somos
More terms from Naohiro Nomoto, Sep 10 2001
More terms from Brad Chalfan (brad(AT)chalfan.net), May 29 2006

A056278 Number of primitive (aperiodic) word structures of length n which contain exactly two different symbols.

Original entry on oeis.org

0, 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, 4294966269, 8589869055, 17179869105
Offset: 1

Views

Author

Keywords

Comments

Permuting the alphabet will not change a word structure. Thus aabc and bbca have the same structure. This is identical to A000740 for n>1.

References

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

Crossrefs

Apart from initial term, this is a duplicate of A000740.
Column 2 of A137651.
Cf. A056267.

Formula

a(n) = Sum_{d|n} mu(d)*A000225(n/d-1) where n>0.
G.f.: Sum_{k>=1} mu(k) * x^(2*k) / ((1 - x^k) * (1 - 2*x^k)). - Ilya Gutkovskiy, Apr 15 2021

Extensions

Terms a(30) and beyond from Andrew Howroyd, Apr 15 2021

A381936 Number of primitive binary words of length n that avoid 11, start with 1 and end with 0.

Original entry on oeis.org

0, 1, 1, 1, 3, 3, 8, 11, 20, 30, 55, 83, 144, 224, 373, 597, 987, 1572, 2584, 4146, 6756, 10890, 17711, 28557, 46365, 74880, 121372, 196184, 317811, 513818, 832040, 1345659, 2178253, 3523590, 5702876, 9225784, 14930352, 24155232, 39088024, 63241794, 102334155, 165573148, 267914296
Offset: 1

Views

Author

Aidan Diekmann, Mar 10 2025

Keywords

Comments

Here primitive means the word is not two or more repetitions of a smaller word.

Examples

			For n=5, the a(6) = 3 words are: 100000, 100010, 101000.
Notice 100100 is not included since it is repetitions of the smaller word 100 (from n=3).
		

Crossrefs

Programs

  • PARI
    a(n) = sumdiv(n,d,moebius(d)*fibonacci(n/d-1)) \\ Andrew Howroyd, Mar 10 2025
    
  • Python
    from sympy import mobius, fibonacci, divisors
    def A381936(n): return sum(mobius(n//d)*fibonacci(d-1) for d in divisors(n,generator=True)) # Chai Wah Wu, Mar 18 2025

Formula

a(n) = Sum_{d|n} mu(d) * Fibonacci(n/d-1).
Showing 1-5 of 5 results.