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

A006156 Number of ternary squarefree words of length n.

Original entry on oeis.org

1, 3, 6, 12, 18, 30, 42, 60, 78, 108, 144, 204, 264, 342, 456, 618, 798, 1044, 1392, 1830, 2388, 3180, 4146, 5418, 7032, 9198, 11892, 15486, 20220, 26424, 34422, 44862, 58446, 76122, 99276, 129516, 168546, 219516, 285750, 372204, 484446, 630666, 821154
Offset: 0

Views

Author

Keywords

Comments

a(n), n > 0, is a multiple of 3 by symmetry. - Michael S. Branicky, Jul 21 2021

Examples

			Let the alphabet be {a,b,c}. Then:
a(1)=3: a, b, c.
a(2)=6: all xy except aa, bb, cc.
a(3)=12: aba, abc, aca, acb and similar words beginning with b and c, for a total of 12.
		

References

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

Crossrefs

Second column of A215075, multiplied by 3!=6.

Programs

  • Mathematica
    (* A simple solution (though not at all efficient beyond n = 12) : *) a[0] = 1; a[n_] := a[n] = Length @ DeleteCases[Tuples[Range[3], n] , {a___, b__, b__, c___} ]; s = {}; Do[Print["a[", n, "] = ", a[n]]; AppendTo[s, a[n]], {n, 0, 12}]; s (* Jean-François Alcover, May 02 2011 *)
    Length/@NestList[DeleteCases[Flatten[Outer[Append, #, Range@3, 1], 1], {_, x__, x__, _}] &, {{}}, 20] (* Vladimir Reshetnikov, May 16 2016 *)
  • Python
    def isf(s): # incrementally squarefree (check factors ending in last letter)
        for l in range(1, len(s)//2 + 1):
            if s[-2*l:-l] == s[-l:]: return False
        return True
    def aupton(nn, verbose=False):
        alst, sfs = [1], set("0")
        for n in range(1, nn+1):
            an = 3*len(sfs)
            sfsnew = set(s+i for s in sfs for i in "012" if isf(s+i))
            alst, sfs = alst+[an], sfsnew
            if verbose: print(n, an)
        return alst
    print(aupton(40)) # Michael S. Branicky, Jul 21 2021

Formula

a(n) >= 2^(n/17), see Zeilberger. Let L = lim_{n->infinity} a(n)^(1/n); then L exists and Grimm proves 1.109999 < L < 1.317278. - Charles R Greathouse IV, Nov 29 2013
L exists since a(n) is submultiplicative; 1.3017597 < L < 1.3017619 (Shur 2012); the gap between the bounds can be made less than any given constant. - Arseny Shur, Apr 22 2015

Extensions

Links corrected by Eric Rowland, Sep 16 2010

A051041 Number of squarefree quaternary words of length n.

Original entry on oeis.org

1, 4, 12, 36, 96, 264, 696, 1848, 4848, 12768, 33480, 87936, 230520, 604608, 1585128, 4156392, 10895952, 28566216, 74887056, 196322976, 514662960, 1349208600, 3536962584, 9272217936, 24307198464, 63721617888, 167046745992, 437914664688, 1147996820376, 3009483583056, 7889385389784, 20682088837608, 54218261608896
Offset: 0

Views

Author

Keywords

Comments

a(n), n > 0, is a multiple of 4 by symmetry. - Michael S. Branicky, Jun 20 2022

Examples

			There are 96 quaternary squarefree words of length 4: each of the words 0102, 0120, 0121, 0123 has 4!=24 images under the permutations of the set {0,1,2,3}. - _Arseny Shur_, Apr 26 2015
G.f. = 1 + 4*x + 12*x^2 + 36*x^3 + 96*x^4 + 264*x^5 + 696*x^6 + 1848*x^7 + ....
		

Crossrefs

Cf. A006156.
Third column of A215075, multiplied by 24 (except for the first three terms). - Arseny Shur, Apr 26 2015

Programs

  • Python
    def isf(s): # incrementally squarefree (check factors ending in last letter)
        for l in range(1, len(s)//2 + 1):
            if s[-2*l:-l] == s[-l:]: return False
        return True
    def aupton(nn, verbose=False):
        alst, sfs = [1], set("1")
        for n in range(1, nn+1):
            an = 4*len(sfs)
            sfsnew = set(s+i for s in sfs for i in "0123" if isf(s+i))
            alst, sfs = alst+[an], sfsnew
            if verbose: print(n, an)
        return alst
    print(aupton(14)) # Michael S. Branicky, Jun 20 2022

Formula

Let L be the limit lim a(n)^{1/n}, which exists because a(n) is a submultiplicative sequence. Then L=2.6215080... (Shur 2010). See (Shur 2012) for the methods of estimating such limits. - Arseny Shur, Apr 26 2015

Extensions

More terms from David Wasserman, Feb 27 2002
a(13)-a(15) from John W. Layman, Mar 03 2004
a(16)-a(25) from Max Alekseyev, Jul 03 2006
a(26)-a(30) from Giovanni Resta, Mar 20 2020

A215070 Number of squarefree words of length n in an n-ary alphabet, with new values 0..n-1 introduced in increasing order.

Original entry on oeis.org

1, 1, 2, 4, 12, 40, 154, 660, 3114, 15930, 87645, 514851, 3211220, 21166029, 146849903, 1068808441, 8136559688, 64621235409, 534207882566
Offset: 1

Views

Author

R. H. Hardin, Aug 02 2012

Keywords

Comments

Diagonal of A215075.

Examples

			Some solutions for n=6:
..0....0....0....0....0....0....0....0....0....0....0....0....0....0....0....0
..1....1....1....1....1....1....1....1....1....1....1....1....1....1....1....1
..2....2....2....0....0....2....2....0....2....0....0....2....2....0....2....2
..1....1....3....2....2....0....3....2....3....2....2....3....3....2....1....1
..0....0....0....3....1....1....4....3....4....0....3....2....1....3....0....3
..1....3....2....0....0....3....5....4....0....1....2....0....2....1....2....4
		

A215071 Number of squarefree words of length n in a 5-ary alphabet, with new values 0..4 introduced in increasing order.

Original entry on oeis.org

1, 1, 2, 4, 12, 39, 138, 503, 1864, 6936, 25868, 96512, 360203, 1344408, 5018051, 18729944, 69910398, 260943079, 973980990, 3635421345, 13569354266, 50648137765, 189046143161
Offset: 1

Views

Author

R. H. Hardin Aug 02 2012

Keywords

Comments

Column 4 of A215075

Examples

			Some solutions for n=6
..0....0....0....0....0....0....0....0....0....0....0....0....0....0....0....0
..1....1....1....1....1....1....1....1....1....1....1....1....1....1....1....1
..2....2....2....2....0....2....2....2....0....2....2....0....2....2....0....2
..0....3....3....1....2....3....3....1....2....1....0....2....0....3....2....3
..1....4....0....3....3....0....0....3....3....3....3....3....2....2....0....1
..0....0....1....2....0....2....3....4....1....0....4....4....1....4....3....0
		

A215072 Number of squarefree words of length n in a 6-ary alphabet, with new values 0..5 introduced in increasing order.

Original entry on oeis.org

1, 1, 2, 4, 12, 40, 153, 638, 2825, 12938, 60458, 285664, 1358283, 6480694, 30979999, 148249768, 709832688, 3399805736, 16286469156, 78026226228, 373832145200, 1791120945112
Offset: 1

Views

Author

R. H. Hardin, Aug 02 2012

Keywords

Comments

Column 5 of A215075.

Examples

			Some solutions for n=9
..0....0....0....0....0....0....0....0....0....0....0....0....0....0....0....0
..1....1....1....1....1....1....1....1....1....1....1....1....1....1....1....1
..2....2....2....2....2....2....2....2....2....2....0....2....0....2....2....2
..3....1....0....3....0....3....3....0....3....0....2....0....2....3....0....3
..4....3....3....0....3....4....2....3....1....3....1....3....1....4....3....4
..3....2....0....2....2....5....0....0....2....0....3....4....2....2....4....2
..5....4....2....4....3....3....2....4....4....2....0....3....0....3....1....0
..0....3....4....3....4....4....1....3....5....4....1....2....1....0....0....2
..3....4....2....5....3....1....4....5....4....0....3....0....0....2....2....3
		

Crossrefs

Cf. A215075.

A215073 Number of squarefree words of length n in a 7-ary alphabet, with new values 0..6 introduced in increasing order.

Original entry on oeis.org

1, 1, 2, 4, 12, 40, 154, 659, 3085, 15438, 81200, 442206, 2465945, 13968206, 79933735, 460447075, 2663586832, 15450089345, 89773528848, 522212524474
Offset: 1

Views

Author

R. H. Hardin Aug 02 2012

Keywords

Comments

Column 6 of A215075

Examples

			Some solutions for n=9
..0....0....0....0....0....0....0....0....0....0....0....0....0....0....0....0
..1....1....1....1....1....1....1....1....1....1....1....1....1....1....1....1
..0....2....2....2....0....2....0....2....0....2....2....0....2....2....2....2
..2....3....3....0....2....3....2....3....2....3....0....2....3....1....0....0
..3....2....0....3....3....2....3....2....0....4....3....3....1....3....2....3
..4....0....4....4....0....4....2....1....3....0....4....4....2....1....1....2
..5....4....5....5....2....2....1....0....1....3....3....3....0....4....2....0
..2....5....2....1....0....3....0....2....2....4....0....5....4....0....3....1
..5....1....4....5....3....2....3....1....1....3....2....6....3....3....4....4
		

A215074 Number of squarefree words of length n in an 8-ary alphabet, with new values 0..7 introduced in increasing order.

Original entry on oeis.org

1, 1, 2, 4, 12, 40, 154, 660, 3113, 15893, 86857, 502092, 3036032, 19006591, 122119857, 799665333, 5308126648, 35576413852, 240063646519, 1627605038848
Offset: 1

Views

Author

R. H. Hardin Aug 02 2012

Keywords

Comments

Column 7 of A215075.

Examples

			Some solutions for n=9:
..0....0....0....0....0....0....0....0....0....0....0....0....0....0....0....0
..1....1....1....1....1....1....1....1....1....1....1....1....1....1....1....1
..2....2....2....2....2....2....2....2....2....2....2....2....2....2....2....2
..3....0....1....3....1....3....3....1....3....3....0....3....1....1....3....0
..4....3....3....4....3....4....4....3....4....0....3....4....3....3....4....3
..0....1....1....5....4....5....1....0....2....2....4....5....4....0....0....4
..3....4....0....4....0....4....5....4....5....4....5....6....0....1....1....0
..1....2....4....0....2....1....3....2....0....5....1....7....5....0....0....5
..2....0....1....6....3....2....0....5....1....4....6....2....1....3....5....2
		

A343484 Number of equivalence classes of length n squarefree reduced words over {0, 1, 2, 3} under action of renaming symbols.

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 8, 13, 18, 27, 41, 62, 90, 134, 198, 293, 423, 619, 908, 1329, 1938, 2832, 4142, 6061, 8824, 12879, 18794, 27425, 39977, 58333, 85109, 124180, 180994, 263931, 384933, 561402, 818617, 1193841, 1740980, 2538896, 3702022, 5398458, 7872351
Offset: 0

Views

Author

James Rayman, Apr 16 2021

Keywords

Comments

Any equivalence class of words with length at least 2 has exactly 8 members.

Examples

			a(5) = 5 corresponds to the 5 words 01210, 01030, 01230, 01032, and 01232.
		

Crossrefs

Formula

a(n) = A343421(n)/8 for n >= 2.
Showing 1-8 of 8 results.