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

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

A143325 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) which are earlier in lexicographic order than any other word derived by cyclic shifts of the alphabet.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 3, 0, 1, 3, 8, 6, 0, 1, 4, 15, 24, 15, 0, 1, 5, 24, 60, 80, 27, 0, 1, 6, 35, 120, 255, 232, 63, 0, 1, 7, 48, 210, 624, 1005, 728, 120, 0, 1, 8, 63, 336, 1295, 3096, 4095, 2160, 252, 0, 1, 9, 80, 504, 2400, 7735, 15624, 16320, 6552, 495, 0, 1, 10, 99
Offset: 1

Views

Author

Alois P. Heinz, Aug 07 2008

Keywords

Comments

Column k is Dirichlet convolution of mu(n) with k^(n-1). 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+k^3.

Examples

			T(4,2)=6, because 6 words of length 4 over 2-letter alphabet {a,b} are primitive and earlier than others derived by cyclic shifts of the alphabet: aaab, aaba, aabb, abaa, abba, abbb; note that aaaa and abab are not primitive and words beginning with b can be derived by shifts of the alphabet from words in the list; secondly note that the words in the list need not be Lyndon words, for example aaba can be derived from aaab by a cyclic rotation of the positions.
Table begins:
  1,   1,    1,     1,     1,      1,      1,       1, ...
  0,   1,    2,     3,     4,      5,      6,       7, ...
  0,   3,    8,    15,    24,     35,     48,      63, ...
  0,   6,   24,    60,   120,    210,    336,     504, ...
  0,  15,   80,   255,   624,   1295,   2400,    4095, ...
  0,  27,  232,  1005,  3096,   7735,  16752,   32697, ...
  0,  63,  728,  4095, 15624,  46655, 117648,  262143, ...
  0, 120, 2160, 16320, 78000, 279720, 823200, 2096640, ...
		

Crossrefs

Rows n=1-5, 7 give: A000012, A001477, A005563, A007531, A123865, A123866.
Main diagonal gives A075147.

Programs

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

Formula

T(n,k) = Sum_{d|n} k^(d-1) * mu(n/d).
T(n,k) = k^(n-1) - Sum_{d
T(n,k) = A074650(n,k) * n/k.
T(n,k) = A143324(n,k) / k.

A152061 Counts of unique periodic binary strings of length n.

Original entry on oeis.org

0, 0, 2, 2, 4, 2, 10, 2, 16, 8, 34, 2, 76, 2, 130, 38, 256, 2, 568, 2, 1036, 134, 2050, 2, 4336, 32, 8194, 512, 16396, 2, 33814, 2, 65536, 2054, 131074, 158, 266176, 2, 524290, 8198, 1048816, 2, 2113462, 2, 4194316, 33272, 8388610, 2, 16842496, 128, 33555424
Offset: 0

Author

Jin S. Choi, Sep 24 2011

Keywords

Comments

a(p) = 2 for p prime.

Examples

			a(3) = 2 = |{ 000, 111 }|, a(4) = 4 = |{ 0000, 1111, 0101, 1010 }|.
		

Crossrefs

Row sums of A050870.
A050871 is bisection (even part). - R. J. Mathar, Sep 24 2011

Programs

  • Maple
    with(numtheory):
    a:= n-> `if`(n=0, 0, 2^n -add(mobius(n/d)*2^d, d=divisors(n))):
    seq(a(n), n=0..100);  # Alois P. Heinz, Sep 26 2011
  • Mathematica
    a[0] = 0; a[n_] := 2^n - Sum[MoebiusMu[n/d]*2^d, {d, Divisors[n]}];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jul 04 2019 *)
  • Python
    from sympy import mobius, divisors
    def A152061(n): return -sum(mobius(n//d)<Chai Wah Wu, Sep 21 2024

Formula

a(n) = 2^n - A001037(n) * n for n>0, a(0) = 0.
a(n) = 2^n - A027375(n) for n>0, a(0) = 0.
a(n) = 2^n - Sum_{d|n} mu(n/d) 2^d for n>0, a(0) = 0.
a(n) = 2^n - A143324(n,2).
a(n) = 2 * A178472(n) for n > 0. - Alois P. Heinz, Jul 04 2019

A143326 Table T(n,k) by antidiagonals. T(n,k) is the number of primitive (=aperiodic) k-ary words with length less than or equal to n (n,k >= 1).

Original entry on oeis.org

1, 2, 1, 3, 4, 1, 4, 9, 10, 1, 5, 16, 33, 22, 1, 6, 25, 76, 105, 52, 1, 7, 36, 145, 316, 345, 106, 1, 8, 49, 246, 745, 1336, 1041, 232, 1, 9, 64, 385, 1506, 3865, 5356, 3225, 472, 1, 10, 81, 568, 2737, 9276, 19345, 21736, 9705, 976, 1, 11, 100, 801, 4600, 19537, 55686
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 -k+k^3+k^4.

Examples

			T(2,3) = 9, because there are 9 primitive words of length less than or equal to 2 over 3-letter alphabet {a,b,c}: 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,       6,       7,        8, ...
  1,   4,    9,    16,     25,      36,      49,       64, ...
  1,  10,   33,    76,    145,     246,     385,      568, ...
  1,  22,  105,   316,    745,    1506,    2737,     4600, ...
  1,  52,  345,  1336,   3865,    9276,   19537,    37360, ...
  1, 106, 1041,  5356,  19345,   55686,  136801,   298936, ...
  1, 232, 3225, 21736,  97465,  335616,  960337,  2396080, ...
  1, 472, 9705, 87016, 487465, 2013936, 6722737, 19169200, ...
  ...
From _Wolfdieter Lang_, Feb 01 2014: (Start)
The triangle Tri(n,m) := T(m,n-(m-1)) begins:
n\m  1   2    3     4     5      6      7     8    9  10 ...
1:   1
2:   2   1
3:   3   4    1
4:   4   9   10     1
5:   5  16   33    22     1
6:   6  25   76   105    52      1
7:   7  36  145   316   345    106      1
8:   8  49  246   745  1336   1041    232     1
9:   9  64  385  1506  3865   5356   3225   472    1
10: 10  81  568  2737  9276  19345  21736  9705  976   1
...
For the columns see A000027, A000290, A081437, ... (End)
		

Crossrefs

Column 1: A000012. Rows 1-3: A000027, A000290, A081437 and A085490. See also A143324, A143327, A134541, A008683.

Programs

  • Maple
    with(numtheory):
    f0:= proc(n) option remember;
           unapply(k^n-add(f0(d)(k), d=divisors(n) minus {n}), k)
         end:
    g0:= proc(n) option remember; unapply(add(f0(j)(x), j=1..n), x) end:
    T:= (n, k)-> g0(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, Divisors[n] // Most}]]; g0[n_] := g0[n] = Function[x, Sum[f0[j][x], {j, 1, n}]]; T[n_, k_] := g0[n][k]; Table[T[n, 1+d-n], {d, 1, 12}, {n, 1, d}]//Flatten (* Jean-François Alcover, Feb 12 2014, translated from Maple *)

Formula

T(n,k) = Sum_{1<=j<=n} Sum_{d|j} k^d * mu(j/d).
T(n,k) = Sum_{1<=j<=n} A143324(j,k).
T(n,k) = A143327(n,k) * k.

A054718 Number of ternary sequences with primitive period n.

Original entry on oeis.org

1, 3, 6, 24, 72, 240, 696, 2184, 6480, 19656, 58800, 177144, 530640, 1594320, 4780776, 14348640, 43040160, 129140160, 387400104, 1162261464, 3486725280, 10460350992, 31380882456, 94143178824, 282428998560, 847288609200, 2541864234000, 7625597465304
Offset: 0

Author

N. J. A. Sloane, Apr 20 2000

Keywords

Comments

Equivalently, output sequences with primitive period n from a simple cycling shift register.

Crossrefs

Column k=3 of A143324.

Programs

  • Maple
    with(numtheory):
    a:= n-> `if`(n=0, 1, add(mobius(d)*3^(n/d), d=divisors(n))):
    seq(a(n), n=0..30);  # Alois P. Heinz, Oct 21 2012
  • Mathematica
    a[0] = 1; a[n_] := Sum[MoebiusMu[d]*3^(n/d), {d, Divisors[n]}]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 11 2014, after Alois P. Heinz *)
  • PARI
    a(n) = if(n==0,1,sumdiv(n,d, moebius(d) * 3^(n/d) )); \\ Joerg Arndt, Apr 14 2013

Formula

a(n) = Sum_{d|n} mu(d)*3^(n/d).
a(0) = 1, a(n) = n * A027376(n).
a(n) = 3 * A034741(n).
G.f.: 1 + 3 * Sum_{k>=1} mu(k) * x^k / (1 - 3*x^k). - Ilya Gutkovskiy, Apr 14 2021

A054719 Number of 4-ary sequences with primitive period n.

Original entry on oeis.org

1, 4, 12, 60, 240, 1020, 4020, 16380, 65280, 262080, 1047540, 4194300, 16772880, 67108860, 268419060, 1073740740, 4294901760, 17179869180, 68719210560, 274877906940, 1099510578960, 4398046494660, 17592181850100, 70368744177660, 281474959868160
Offset: 0

Author

N. J. A. Sloane, Apr 20 2000

Keywords

Comments

Equivalently, output sequences with primitive period n from a simple cycling shift register.

Crossrefs

Column k=4 of A143324.

Programs

  • Maple
    A054719 := proc(n) local d,s; if n = 0 then RETURN(1); else s := 0; for d in divisors(n) do s := s+mobius(d)*4^(n/d); od; RETURN(s); fi; end;
  • Mathematica
    a[0] = 1; a[n_] := Sum[MoebiusMu[d]*4^(n/d), {d, Divisors[n]}]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 11 2014 *)

Formula

a(n) = Sum_{d|n} mu(d)*4^(n/d).
a(n) = n * A027377(n), n>0.
G.f.: 1 + 4 * Sum_{k>=1} mu(k) * x^k / (1 - 4*x^k). - Ilya Gutkovskiy, Apr 14 2021

A054720 Number of 5-ary sequences with primitive period n.

Original entry on oeis.org

1, 5, 20, 120, 600, 3120, 15480, 78120, 390000, 1953000, 9762480, 48828120, 244124400, 1220703120, 6103437480, 30517574880, 152587500000, 762939453120, 3814695297000, 19073486328120, 95367421874400, 476837158124880, 2384185742187480, 11920928955078120
Offset: 0

Author

N. J. A. Sloane, Apr 20 2000

Keywords

Comments

Equivalently, output sequences with primitive period n from a simple cycling shift register.

References

  • E. N. Gilbert and J. Riordan, Symmetry types of periodic sequences, Illinois J. Math., 5 (1961), 657-665.

Crossrefs

Column k=5 of A143324.

Programs

  • Maple
    with(numtheory):
    a:= n-> `if`(n=0, 1, add(mobius(d)*5^(n/d), d=divisors(n))):
    seq(a(n), n=0..30);  # Alois P. Heinz, Oct 21 2012
  • Mathematica
    a[0] = 1; a[n_] := Sum[MoebiusMu[d]*5^(n/d), {d, Divisors[n]}]; Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Mar 11 2014 *)

Formula

Sum mu(d)*5^(n/d); d|n.
a(0) = 1, a(n) = n * A001692(n).
G.f.: 1 + 5 * Sum_{k>=1} mu(k) * x^k / (1 - 5*x^k). - Ilya Gutkovskiy, Apr 14 2021

A284871 Array read by antidiagonals: T(n,k) = number of primitive (aperiodic) reversible strings of length n using a maximum of k different symbols.

Original entry on oeis.org

1, 2, 0, 3, 1, 0, 4, 3, 4, 0, 5, 6, 15, 7, 0, 6, 10, 36, 39, 18, 0, 7, 15, 70, 126, 132, 29, 0, 8, 21, 120, 310, 540, 357, 70, 0, 9, 28, 189, 645, 1620, 2034, 1131, 126, 0, 10, 36, 280, 1197, 3990, 7790, 8316, 3276, 266, 0
Offset: 1

Author

Andrew Howroyd, Apr 04 2017

Keywords

Comments

A string and its reverse are considered to be equivalent.

Examples

			Table starts:
1   2    3     4      5      6       7       8 ...
0   1    3     6     10     15      21      28 ...
0   4   15    36     70    120     189     280 ...
0   7   39   126    310    645    1197    2044 ...
0  18  132   540   1620   3990    8568   16632 ...
0  29  357  2034   7790  23295   58779  131012 ...
0  70 1131  8316  39370 140610  412965 1050616 ...
0 126 3276 32760 195300 839790 2882376 8388576 ...
...
		

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

Columns 2-6 are A045625, A056314, A056315, A056316, A056317.

Programs

  • Mathematica
    b[n_, k_] := (k^n + k^Ceiling[n/2])/2;
    a[n_, k_] := DivisorSum[n, MoebiusMu[n/#] b[#, k]&];
    Table[a[n-k+1, k], {n, 1, 10}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Jun 05 2017, translated from PARI *)
  • PARI
    b(n,k) = (k^n + k^(ceil(n/2))) / 2;
    a(n,k) = sumdiv(n,d, moebius(n/d) * b(d,k));
    for(n=1, 10, for(k=1, 10, print1( a(n,k),", ");); print(););

Formula

T(n, k) = Sum_{d | n} mu(n/d) * (k^n + k^(ceiling(n/2))) / 2.

A054721 Number of 6-ary sequences with primitive period n.

Original entry on oeis.org

1, 6, 30, 210, 1260, 7770, 46410, 279930, 1678320, 10077480, 60458370, 362797050, 2176734420, 13060694010, 78363884130, 470184976590, 2821108227840, 16926659444730, 101559946544280, 609359740010490, 3656158379595540, 21936950640097710, 131621703479470050
Offset: 0

Author

N. J. A. Sloane, Apr 20 2000

Keywords

Comments

Equivalently, output sequences with primitive period n from a simple cycling shift register.

Crossrefs

Column k=6 of A143324.

Programs

  • Maple
    with(numtheory):
    a:= n-> `if`(n=0, 1, add(mobius(d)*6^(n/d), d=divisors(n))):
    seq(a(n), n=0..30);  # Alois P. Heinz, Oct 21 2012
  • Mathematica
    a[0] = 1; a[n_] := Sum[MoebiusMu[d]*6^(n/d), {d, Divisors[n]}]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 11 2014 *)

Formula

a(n) = Sum mu(d)*6^(n/d); d|n.
a(0) = 1, a(n) = n * A032164(n).
G.f.: 1 + 6 * Sum_{k>=1} mu(k) * x^k / (1 - 6*x^k). - Ilya Gutkovskiy, Apr 14 2021

A143328 Table T(n,k) read by antidiagonals. T(n,k) is the number of primitive (=aperiodic) k-ary Lyndon words (n,k >= 1) with length less than or equal to n.

Original entry on oeis.org

1, 2, 1, 3, 3, 1, 4, 6, 5, 1, 5, 10, 14, 8, 1, 6, 15, 30, 32, 14, 1, 7, 21, 55, 90, 80, 23, 1, 8, 28, 91, 205, 294, 196, 41, 1, 9, 36, 140, 406, 829, 964, 508, 71, 1, 10, 45, 204, 728, 1960, 3409, 3304, 1318, 127, 1, 11, 55, 285, 1212, 4088, 9695, 14569, 11464, 3502, 226, 1
Offset: 1

Author

Alois P. Heinz, Aug 07 2008

Keywords

Examples

			T(3,2) = 5, because 5 words of length <=3 over 2-letter alphabet {a,b} are primitive Lyndon words: a, b, ab, aab, abb.
Table begins:
  1,  2,  3,   4,   5,  ...
  1,  3,  6,  10,  15,  ...
  1,  5, 14,  30,  55,  ...
  1,  8, 32,  90, 205,  ...
  1, 14, 80, 294, 829,  ...
		

Crossrefs

Columns k=1-5 give: A000012, A062692, A114945, A114946, A114947.
Rows n=1-4 give: A000027, A000217, A000330, A132117.
Main diagonal gives A215475.

Programs

  • Maple
    with(numtheory):
    f0:= proc(n) option remember; unapply(k^n-add(f0(d)(k),
            d=divisors(n)minus{n}), k)
         end:
    f2:= proc(n) option remember; unapply(f0(n)(x)/n, x) end:
    g2:= proc(n) option remember; unapply(add(f2(j)(x), j=1..n), x) end:
    T:= (n,k)-> g2(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, Divisors[n]//Most}]]; f2[n_] := f2[n] = Function[x, f0[n][x]/n]; g2[n_] := g2[n] = Function[x, Sum[f2[j][x], {j, 1, n}]]; T[n_, k_] := g2[n][k]; Table[T[n, 1+d-n], {d, 1, 12}, {n, 1, d}]//Flatten (* Jean-François Alcover, Feb 12 2014, translated from Maple *)

Formula

T(n,k) = Sum_{1<=j<=n} (1/j) * Sum_{d|j} mu(j/d)*k^d.
T(n,k) = Sum_{1<=j<=n} A074650(j,k).
Showing 1-10 of 26 results. Next