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

A177736 Partial sums of A006156.

Original entry on oeis.org

1, 4, 10, 22, 40, 70, 112, 172, 250, 358, 502, 706, 970, 1312, 1768, 2386, 3184, 4228, 5620, 7450, 9838, 13018, 17164, 22582, 29614, 38812, 50704, 66190, 86410, 112834, 147256, 192118, 250564, 326686, 425962, 555478, 724024, 943540, 1229290
Offset: 0

Views

Author

Jonathan Vos Post, May 12 2010

Keywords

Comments

Partial sums of number of ternary squarefree words of length n. Is this always even after a(0) = 1? If so, there are no prime elements, and the subsequence of semiprime elements begins: 358, 502, 706, 2386, 9838, 112834, 192118, 425962. As Weisstein writes in the Mathworld link from A006156: A "square" word consists of two identical adjacent subwords (for example, acbacb). A squarefree word contains no square words as subwords (for example, abcacbabcb). The only squarefree binary words are a, b, ab, ba, aba, and bab (since aa, bb, aaa, aab, abb, baa, bba, and bbb contain square identical adjacent subwords a, b, a, a, b, a, b, and b, respectively). However, there are arbitrarily long ternary squarefree words.

Crossrefs

Formula

a(n) = Sum_{i=0..n} A006156(i).

A273155 Decimal expansion of the limit A006156(n)^(1/n) as n tends to infinity.

Original entry on oeis.org

1, 3, 0, 1, 7
Offset: 1

Views

Author

Vladimir Reshetnikov, May 16 2016

Keywords

Comments

The constant describes the asymptotic behavior of the number of ternary squarefree words.
The next term a(6) is known to be either 6 or 5 (in the latter case it is followed by a(7) = 9).

Examples

			1.3017...
		

Crossrefs

Cf. A006156.

A215075 T(n,k) = Number of squarefree words of length n in a (k+1)-ary alphabet, with new values 0..k introduced in increasing order.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 2, 3, 0, 1, 1, 2, 4, 5, 0, 1, 1, 2, 4, 11, 7, 0, 1, 1, 2, 4, 12, 29, 10, 0, 1, 1, 2, 4, 12, 39, 77, 13, 0, 1, 1, 2, 4, 12, 40, 138, 202, 18, 0, 1, 1, 2, 4, 12, 40, 153, 503, 532, 24, 0, 1, 1, 2, 4, 12, 40, 154, 638, 1864, 1395, 34, 0, 1, 1, 2, 4, 12, 40, 154, 659
Offset: 1

Views

Author

R. H. Hardin, Aug 02 2012

Keywords

Comments

Alternative definition: for (k+1)-ary words u=u_1...u_n and v=v_1...v_n, let u~v if there exists a permutation t of the alphabet such that v_i=t(u_i), i=1,...,n. Then ~ preserves length and squarefreeness, and T(n,k) is the number of equivalence classes of (k+1)-ary squarefree words of length n. - Arseny Shur, Apr 26 2015

Examples

			Table starts
.1..1....1.....1......1......1......1......1......1......1......1......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
.0..3....4.....4......4......4......4......4......4......4......4......4......4
.0..5...11....12.....12.....12.....12.....12.....12.....12.....12.....12.....12
.0..7...29....39.....40.....40.....40.....40.....40.....40.....40.....40.....40
.0.10...77...138....153....154....154....154....154....154....154....154....154
.0.13..202...503....638....659....660....660....660....660....660....660....660
.0.18..532..1864...2825...3085...3113...3114...3114...3114...3114...3114...3114
.0.24.1395..6936..12938..15438..15893..15929..15930..15930..15930..15930..15930
.0.34.3664.25868..60458..81200..86857..87599..87644..87645..87645..87645..87645
.0.44.9605.96512.285664.442206.502092.513649.514795.514850.514851.514851.514851
...
Some solutions for n=6 k=4
..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....2....2....0....2
..3....3....0....0....1....3....0....3....1....0....2....3....3....3....2....1
..1....2....3....3....0....0....3....1....3....2....1....4....1....4....0....0
..0....0....1....0....3....3....2....3....1....1....2....1....2....0....1....2
		

Crossrefs

Column 2 is A060688(n-1), or A006156 divided by 6 (for n>1).
Column 3 is A118311, or A051041 divided by 24 (for n>3).

Formula

From Arseny Shur, Apr 26 2015: (Start)
Let L_k be the limit lim T(n,k)^{1/n}, which exists because T(n,k) is a submultiplicative sequence for any k. Then L_k=k-1/k-1/k^3-O(1/k^5) (Shur, 2010).
Exact values of L_k for small k, rounded up to several decimal places:
L_2=1.30176..., L_3=2.6215080..., L_4=3.7325386... (for L_5,...,L_14 see Shur arXiv:1009.4415).
Empirical observation: for k=2 the O-term in the general formula is slightly bigger than 2/k^5, and for k=3,...,14 this O-term is slightly smaller than 2/k^5.
(End)

A214943 T(n,k) = Number of squarefree words of length n in a (k+1)-ary alphabet.

Original entry on oeis.org

2, 3, 2, 4, 6, 2, 5, 12, 12, 0, 6, 20, 36, 18, 0, 7, 30, 80, 96, 30, 0, 8, 42, 150, 300, 264, 42, 0, 9, 56, 252, 720, 1140, 696, 60, 0, 10, 72, 392, 1470, 3480, 4260, 1848, 78, 0, 11, 90, 576, 2688, 8610, 16680, 15960, 4848, 108, 0, 12, 110, 810, 4536, 18480, 50190, 80040
Offset: 1

Views

Author

R. H. Hardin, Jul 30 2012

Keywords

Comments

Table starts
.2..3...4....5.....6.....7......8......9.....10......11......12......13......14
.2..6..12...20....30....42.....56.....72.....90.....110.....132.....156.....182
.2.12..36...80...150...252....392....576....810....1100....1452....1872....2366
.0.18..96..300...720..1470...2688...4536...7200...10890...15840...22308...30576
.0.30.264.1140..3480..8610..18480..35784..64080..107910..172920..265980..395304
.0.42.696.4260.16680.50190.126672.281736.569520.1068210.1886280.3169452.5108376
Empirical: row n is a polynomial of degree n
Coefficients for rows 1-12, highest power first:
...1...1
...1...1...0
...1...1...0...0
...1...1..-1..-1...0
...1...1..-2..-1...1...0
...1...1..-3..-2...2...1...0
...1...1..-4..-3...5...2..-2...0
...1...1..-5..-4...8...4..-4..-1...0
...1...1..-6..-5..12...8..-9..-4...2...0
...1...1..-7..-6..17..12.-17..-7...6...0...0
...1...1..-8..-7..23..17.-28.-13..10...2...2...0
...1...1..-9..-8..30..23.-45.-23..25...3..-2...4...0
Terms in column k are multiples of k+1 due to symmetry. - Michael S. Branicky, May 20 2021

Examples

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

Crossrefs

Cf. A006156 (column 2), A051041 (column 3), A214939 (column 4).
Cf. A002378 (row 2), A011379 (row 3), A047929(n+1) (row 4).

Programs

  • Python
    from itertools import product
    def T(n, k):
      if n == 1: return k+1
      symbols = "".join(chr(48+i) for i in range(k+1))
      squares = ["".join(u)*2 for r in range(1, n//2 + 1)
        for u in product(symbols, repeat = r)]
      words = ("0" + "".join(w) for w in product(symbols, repeat=n-1))
      return (k+1)*sum(all(s not in w for s in squares) for w in words)
    def atodiag(maxd): # maxd antidiagonals
      return [T(n, d+1-n) for d in range(1, maxd+1) for n in range(1, d+1)]
    print(atodiag(11)) # Michael S. Branicky, May 20 2021

Formula

From Arseny Shur, Apr 26 2015: (Start)
Let L_k be the limit lim T(n,k)^{1/n}, which exists because T(n,k) is a submultiplicative sequence for any k. Then L_k=k-1/k-1/k^3-O(1/k^5) (Shur, 2010).
Exact values of L_k for small k, rounded up to several decimal places:
L_2=1.30176..., L_3=2.6215080..., L_4=3.7325386... (for L_5,...,L_14 see Shur arXiv:1009.4415).
Empirical observation: for k=2 the O-term in the general formula is slightly bigger than 2/k^5, and for k=3,...,14 this O-term is slightly smaller than 2/k^5.
(End)

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

A060688 Number of dissimilar ternary squarefree words of length n+1.

Original entry on oeis.org

1, 2, 3, 5, 7, 10, 13, 18, 24, 34, 44, 57, 76, 103, 133, 174, 232, 305, 398, 530, 691, 903, 1172, 1533, 1982, 2581, 3370, 4404, 5737, 7477, 9741, 12687, 16546, 21586, 28091, 36586, 47625, 62034, 80741, 105111, 136859, 178252
Offset: 1

Views

Author

Frank Ellermann, Apr 19 2001

Keywords

Comments

Cycle b-> c-> b and a-> b-> c-> a to get 6 similar words in A006156(n+1).

Examples

			ab~ac (cycle b,c), ab~bc~ca and ac~ba~cb (cycle a,b,c) => a(1) = 6/6 = 1.
		

References

  • N. Wirth, Systematisches Programmieren, 1975, ch. 15.4, table 15.68

Crossrefs

Cf. A006156.

Programs

  • Mathematica
    (* This program is not convenient for a large number of terms *) a[n_] := a[n] = (1/6)*Length[ DeleteCases[ Tuples[ Range[3], n + 1], {a___, b__, b__, c___}]]; Reap[ Do[ Print["a[", n, "] = ", a[n]]; Sow[a[n]], {n, 1, 12}]][[2, 1]] (* Jean-François Alcover, Jul 24 2013 *)

Formula

a(n) = A006156(n+1)/6. [corrected by Michel Marcus, Nov 26 2020]

A170823 An infinite word on the alphabet 1, 2, 3 by Bollobas.

Original entry on oeis.org

1, 2, 3, 2, 1, 2, 3, 1, 3, 2, 3, 1, 2, 1, 3, 2, 3, 1, 3, 2, 1, 2, 3, 2, 1, 2, 3, 1, 3, 2, 3, 1, 2, 1, 3, 1, 2, 3, 2, 1, 3, 1, 2, 1, 3, 2, 3, 1, 3, 2, 3, 1, 2, 1, 3, 1, 2, 3, 2, 1, 2, 3, 1, 3, 2, 1, 2, 3, 2, 1, 3, 1, 2, 1, 3, 2, 3, 1, 3, 2, 3, 1, 2, 1, 3, 1, 2, 3, 2, 1, 3, 1, 2, 1, 3, 2, 3, 1, 3, 2, 1, 2, 3, 2, 1
Offset: 0

Views

Author

N. J. A. Sloane, Dec 25 2009

Keywords

Comments

A concatenation of blocks u_k, k >= 0, where u_k has length 5^k. The sequence is defined recursively - see the Maple code.
From Kevin Ryde, Aug 11 2020: (Start)
Bollobás gives this sequence intending it to be a squarefree ternary word, where squarefree means nowhere a repeat w w for a block w of any length. However, squares do occur in it, for example a(18) onwards is 3212 3212, or a(19) onwards is 2123 2123.
In Bollobás' proof, the signs sequence is A337004. For blocks w of length l=4, the second signs subsequence presented (which should stop at length 7), does in fact occur, as does one other.
- - + + - - + \ two l=4 signs subsequences
- + + - - + + / in A337004 making squares here
All else in the argument holds, and in particular the "peaks" reduction means the only squares are lengths l = 4*5^k.
Zolotov shows this word is cubefree, and weakly squarefree (no x w w x where x is a single symbol and w is a block, possibly empty). However uniform cyclic squarefree must wait for Leech's order 13 morphism in A337005.
(End)

References

  • B. Bollobas, The Art of Mathematics: Coffee Time in Memphis, Cambridge, 2006, pp. 226-228.

Crossrefs

Cf. A337004 (first differences as +1,-1).

Programs

  • Maple
    a:=[1,2,3,2,1]; b:=[2,3,1,3,2]; c:=[3,1,2,1,3]; S:=[1];
    for m from 1 to 6 do S:=subs({1=a[],2=b[],3=c[]},S); od: S;
  • PARI
    my(table=[0,1,2,1,0]); a(n) = my(v=digits(n,5)); sum(i=1,#v,table[v[i]+1]) %3+1; \\ Kevin Ryde, Jul 31 2020

A242430 Decimal expansion of the unforgeable pattern-free binary word constant, a constant mentioned in A003000.

Original entry on oeis.org

2, 6, 7, 7, 8, 6, 8, 4, 0, 2, 1, 7, 8, 8, 9, 1, 1, 2, 3, 7, 6, 6, 7, 1, 4, 0, 3, 5, 8, 4, 3, 0, 2, 5, 5, 2, 5, 5, 5, 0, 5, 9, 8, 9, 7, 9, 9, 3, 4, 8, 4, 5, 3, 2, 0, 7, 6, 3, 1, 1, 8, 8, 8, 5, 1, 1, 2, 1, 4, 9, 3, 7, 7, 8, 5, 2, 3, 2, 7, 6, 2, 8, 5, 3, 5, 4, 4, 7, 6, 2, 2, 3, 8, 5, 6, 1, 3, 6, 8, 4
Offset: 0

Views

Author

Jean-François Alcover, May 14 2014

Keywords

Comments

A binary word (a word over a 2-letter alphabet) is said "unforgeable" if it never matches a left or right shift of itself. The limit lower bound of the number of unforgeable words of length n is (0.26778684...)*2^n.

Examples

			0.267786840217889112376671403584302552555...
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge University Press, 2003, p. 369.
  • See more references and links in A003000, which is the main entry for this subject.

Crossrefs

Programs

  • Mathematica
    digits = 100; k0 = 5; dk = 5; Clear[r]; r[k_] := r[k] = Sum[(-1)^(n-1)*2/(2^(2^(n+1)-1)-1) * Product[2^(2^m-1)/(2^(2^m-1)-1), {m, 2, n}], {n, 1, k}] // N[#, digits+10]&; r[k0]; r[k = k0 + dk]; While[RealDigits[r[k], 10, digits+10] !=  RealDigits[r[k - dk], 10, digits+10], Print["k = ", k]; k = k + dk]; RealDigits[r[k], 10, digits] // First

A282212 Number of maximal squarefree words of length n over the alphabet {0,1,2}.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 6, 6, 6, 6, 24, 24, 24, 36, 54, 54, 120, 138, 216, 240, 384, 444, 528, 690, 966, 1236, 1602, 2112, 2712, 3522, 4818, 6150, 8094, 10452, 13854, 17784, 23082, 29970, 39438, 51030, 66792, 86502, 113064, 147036, 191952, 249390
Offset: 1

Views

Author

Jeffrey Shallit, Feb 09 2017

Keywords

Comments

A word is "squarefree" if it contains no nonempty block of the form xx.
A squarefree word w is maximal if wa contains a square for all symbols a.
The structure of such words was described by Li (1976). - Jeffrey Shallit, Jan 16 2019
a(n) is a multiple of 3 by symmetry. - Michael S. Branicky, Jul 21 2021

Examples

			For n = 7 the maximal squarefree words are 0102010 and the 5 others induced by permuting the symbols.
		

Crossrefs

Cf. A006156.

Programs

  • Maple
    extend:= proc(w) local res,t,wt,i;
      res:= NULL;
      for t from "0" to "2" do
        wt:= cat(w,t);
        if andmap(i -> wt[-2*i..-i-1] <> wt[-i..-1], [$1..floor(length(wt)/2)]) then res:= wt,res fi
      od:
    res
    end proc:
    L[1]:= ["0"]:
    for n from 1 to 43 do
      A[n]:= 0: L[n+1]:= NULL;
      for t in L[n] do
        r:= extend(t);
        if [r] = [] then A[n]:= A[n]+3
        else L[n+1]:= L[n+1],r
        fi
      od;
      L[n+1]:= [L[n+1]];
    od:
    seq(A[n],n=1..43); # Robert Israel, Feb 09 2017
  • Python
    def isf(s): # incrementally squarefree
        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 = [], set("0")
        for n in range(1, nn+1):
            an, sfsnew = 0, set()
            for s in sfs:
                se = [s+i for i in "012" if isf(s+i)]
                if len(se) > 0: sfsnew.update(se)
                else: an += 3
            alst, sfs = alst+[an], sfsnew
            if verbose: print(n, an)
        return alst
    print(aupton(40)) # Michael S. Branicky, Jul 21 2021

Extensions

a(37)-a(43) from Robert Israel, Feb 09 2017
a(44) and beyond from Michael S. Branicky, Jul 21 2021

A118311 Number of dissimilar squarefree quaternary words of length n.

Original entry on oeis.org

1, 1, 2, 4, 11, 29, 77, 202, 532, 1395, 3664, 9605, 25192, 66047, 173183, 453998, 1190259, 3120294, 8180124, 21444290, 56217025, 147373441, 386342414, 1012799936, 2655067412, 6960281083, 18246444362, 47833200849, 125395149294, 328724391241, 861753701567, 2259094233704
Offset: 1

Views

Author

Alford Arnold, Apr 22 2006

Keywords

Comments

Sherman Stein and A006156 count ordered squarefree(twin-free) ternary words. A060688 counts the dissimilar cases essentially by dividing by 3! (the number of ways to permute a,b,c). A051041 counts ordered squarefree quaternary words. A118311 counts the dissimilar cases (beginning with the 4th term) by dividing A051041 by 4!.

Examples

			a(1) = 1 because a,b,c and d are similar.
a(2) = 1 because aa is not squarefree; so ab is the only valid case.
a(3) = 2 counting aba and abc.
a(4) = 4 counting abac, abca, abcb and abcd.
a(5) = 11 counting abaca,abacb,abcab,abcac,abcba,abacd,abcad,abcbd,abcda,abcdb and abcdc.
		

References

  • Sherman Stein, How The Other Half Thinks, 2001, page 149.

Crossrefs

Extensions

a(16)-a(25) from Max Alekseyev, Jul 03 2006
a(26)-a(30) from Giovanni Resta, Mar 20 2020
Showing 1-10 of 17 results. Next