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

A006697 Number of subwords of length n in infinite word generated by a -> aab, b -> b.

Original entry on oeis.org

1, 2, 4, 6, 9, 13, 17, 22, 28, 35, 43, 51, 60, 70, 81, 93, 106, 120, 135, 151, 167, 184, 202, 221, 241, 262, 284, 307, 331, 356, 382, 409, 437, 466, 496, 527, 559, 591, 624, 658, 693, 729, 766, 804, 843, 883, 924, 966, 1009, 1053, 1098, 1144, 1191, 1239
Offset: 0

Views

Author

Keywords

References

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

Crossrefs

Programs

  • Mathematica
    A103354[n_] := Floor[ FullSimplify[ ProductLog[ 2^n*Log[2]]/Log[2]]]; Accumulate[ Table[ A103354[n], {n, 1, 54}]] (* Jean-François Alcover, Dec 13 2011, after M. F. Hasler *)
  • PARI
    LambertW(y) = solve( X=1,log(y), X*exp(X)-y)
    A006697(n,b=2)=local(m=floor(n+1-LambertW(b^(n+1)*log(b))/log(b)));(b^(m+1)-1)/(b-1)+(n-m)*(n-m+1)/2 \\ M. F. Hasler, Dec 14 2007

Formula

G.f.: 1 + 1/(1-x) + 1/(1-x)^2 * [1/(1-x) - sum(k>=1, x^(2^k+k-1))] (conjectured). - Ralf Stephan, Mar 05 2004
Conjectures: partial sums of A103354, also equal to A094913(n) + 1. - Vladeta Jovovic, Sep 19 2005
a(n) = sum(k=0,n,min(2^k,n-k+1)) = 2^(m+1)-1 + (n-m)(n-m+1)/2 with m = [ n+1-LambertW( 2^(n+1) * log(2) ) / log(2) ] = integer part of the solution to 2^m = n+1-m. (conjectured). - M. F. Hasler, Dec 14 2007

Extensions

More terms from Michel ten Voorde, Apr 11 2001

A094913 Maximal number of distinct nonempty substrings of any binary string of length n.

Original entry on oeis.org

0, 1, 3, 5, 8, 12, 16, 21, 27, 34, 42, 50, 59, 69, 80, 92, 105, 119, 134, 150, 166, 183, 201, 220, 240, 261, 283, 306, 330
Offset: 0

Views

Author

John W. Layman, Jun 17 2004

Keywords

Comments

It would be more natural to include the empty substring, which would result in the sequence b(n)=a(n)+1; all values computed so far confirm the conjecture that a(n)+1 = A006697(n). - M. F. Hasler, Dec 17 2007
In addition to the example given, computation finds 17 other binary strings of length 6 which contain the maximal number a(6)=16 of distinct substrings. Interestingly, each of the 18 such instances gives the same numbers of substrings of each possible length, in this case 2,4,4,3,2,1 substrings of lengths 1 through 6, respectively.
Calculations suggest that, for any n>0, binary strings of length n exist such that the number of distinct substrings of length k, 1<=k<=n, is as large as possible consistent with basic counting principles, i.e., n-k+1 substrings of length k starting at each of the n-k+1 possible starting positions, subject to the condition, however, that there cannot be more than 2^k distinct binary strings of length k. This suggests the following conjecture. Conjecture: The maximum number a(n) of distinct substrings of a binary string of length n is given by a(n) = Sum_{k=1..n} t(k) where t(k) is the smaller of 2^k and n-k+1.
Conjecture: a(n) = A006697(n)-1. - Vladeta Jovovic, Sep 19 2005
Conjecture: a(n) = 2^(m+1)-2 + (n-m)(n-m+1)/2, where m = floor(n+1-LambertW( 2^(n+1) * log(2) ) / log(2) ) = integer part of the solution to 2^x = n+1-x. This is based on the reasoning that you can construct the word of length n so that it contains the maximal possible number, max( n-k+1, 2^k ), of different substrings of length k. - M. F. Hasler, Dec 17 2007
From Peter Pein (petsie(AT)dordos.net), Jan 18 2008: (Start)
The following heuristic seems to work for computing the maximal number of distinct substrings of a binary string of length n.
Start with the empty list and at each step try to insert a zero or a one at each possible position. Then pick the first list with the maximal number of sublists and start over.
Say we have had {0,0,1,1,0} as one of the lists with the maximal number of sublists. Then my candidates for the next test are:
With[{lastbest = {0, 0, 1, 1, 0}}, Union[Flatten[ Outer[Insert[lastbest, #2, #1] &, Range[1 + Length[lastbest]], {0, 1}, 1], 1]]]
{{0, 0, 0, 1, 1, 0}, {0, 0, 1, 0, 1, 0}, {0, 0, 1, 1, 0, 0}, {0, 0, 1, 1, 0, 1}, {0, 0, 1, 1, 1, 0}, {0, 1, 0, 1, 1, 0}, {1, 0, 0, 1, 1, 0}}
See http://freenet-homepage.de/Peter_Berlin/Mathe/heuristicA094913.nb for the Mathematica notebook with the complete (simple) algorithm. There's a screenshot too (same URL but with .png instead of .nb).
If this works correctly, the first 100 values of A094913 are calculated in 30 secs.
(End) [See also the remarks in the Fuller link in A134457.]
From Jon Perry, Nov 16 2010: (Start)
Conjecture: column sums of:
1 3 5 7 9 11 13 ...
1 3 5 7 ...
1 ...
....................
--------------------
1 3 5 8 12 16 21 ... (End)

Examples

			The binary string 000110 of length 6 contains the 16 distinct substrings 0, 1, 00, 01, 11, 10, 000, 001, 011, 110, 0001, 0011, 0110, 00011, 00110, 000110 and a computer search shows that no other binary string of length 6 contains more than 16. Thus a(6)=16.
G.f. = x + 3*x^2 + 5*x^3 + 8*x^4 + 12*x^5 + 16*x^6 + 21*x^7 + 27*x^8 + 34*x^9 + ...
		

Crossrefs

Programs

Extensions

a(19)-a(28) from David W. Wilson, Dec 17 2007
More references (some proving some conjectures) added by Jeffrey Shallit, Nov 21 2015

A134457 a(n) = number of length-n binary strings with A006697(n) distinct substrings.

Original entry on oeis.org

1, 2, 2, 6, 8, 4, 18, 38, 48, 40, 16, 80, 210, 402, 644, 852, 928, 912, 704, 256, 1344, 3944, 9276, 19448, 37090, 65602, 107388, 160760, 220200
Offset: 0

Views

Author

David W. Wilson, Dec 17 2007

Keywords

Comments

Here by "substring" one means a contiguous block within a string (often called "subword" or "factor").

Examples

			Table giving n, A006697(n) = maximal number of distinct substrings of a binary string of length n, a(n), c(n) = lexically first length-n binary string with A006697(n) distinct substrings.
n A006697(n) a(n) c(n)
0 1 1 null
1 2 2 0
2 4 2 01
3 6 6 001
4 9 8 0010
5 13 4 00110
6 17 18 000110
7 22 38 0001011
8 28 48 00010110
9 35 40 000101100
10 43 16 0001011100
11 51 80 00001011100
12 60 210 000010011101
13 70 402 0000100110111
14 81 644 00001001101110
15 93 852 000010011010111
16 106 928 0000100110101110
17 120 912 00001001101011100
18 135 704 000010011010111000
19 151 256 0000100110101111000
20 167 1344 00000100110101111000
21 184 3944 000001000110101111001
22 202 9276 0000010001100101111010
23 221 19448 00000100011001010111101
24 241 37090 000001000110010101111010
25 262 65602 0000010001100101001111011
26 284 107388 00000100011001010011101111
27 307 160760 000001000110010100111011110
28 331 220200 0000010001100101001110101111
For (conjectural?) further values see the _Martin Fuller_ link.
		

Crossrefs

Cf. A006697, A134466(n) = decimal value of c(n) interpreted as a binary number.

Extensions

Link to comments on history of the problem added by Jeffrey Shallit, May 08 2016
Showing 1-3 of 3 results.