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

A116909 Start with the sequence 2322322323222323223223 and extend by always appending the curling number (cf. A094004).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jan 15 2009, based on email from Benjamin Chaffin, Apr 09 2008 and Dec 04 2009

Keywords

Comments

The (unproved) Curling Number Conjecture is that any starting sequence eventually leads to a "1". The starting sequence used here extends for a total of 142 steps before reaching 1. After than it continues as A090822.
Benjamin Chaffin has found that in a certain sense this is the best of all 2^45 starting sequences of at most 44 2's and 3's.
Note that a(362) = 4. The sequence is unbounded, but a(n) = 5 is not reached until about n = 10^(10^23) - see A090822.

Crossrefs

Cf. A094004, A090822, A174998. Sequence of run lengths: A161223.

A160766 Values of n for which A094004(n) > A094004(n-1)+1.

Original entry on oeis.org

1, 2, 4, 6, 8, 9, 10, 11, 14, 19, 22, 48
Offset: 1

Views

Author

Keywords

Comments

The next three terms are conjectured to be 68, 76 and 77.

A093340 Erroneous version of A094004.

Original entry on oeis.org

1, 4, 4, 8, 9, 14, 15, 66, 68, 70, 123, 123, 125, 132, 133, 134, 135, 136, 138, 139
Offset: 1

Views

Author

Keywords

A090822 Gijswijt's sequence: a(1) = 1; for n>1, a(n) = largest integer k such that the word a(1)a(2)...a(n-1) is of the form xy^k for words x and y (where y has positive length), i.e., the maximal number of repeating blocks at the end of the sequence so far.

Original entry on oeis.org

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

Views

Author

Dion Gijswijt, Feb 27 2004

Keywords

Comments

Here xy^k means the concatenation of the words x and k copies of y.
The name "Gijswijt's sequence" is due to N. J. A. Sloane, not the author!
Fix n and suppose a(n) = k. Let len_y(n) = length of shortest y for this k and let len_x = n-1 - k*len_y(n) = corresponding length of x. A091407 and A091408 give len_y and len_x. For the subsequence when len_x = 0 see A091410 and A091411.
The first 4 occurs at a(220) (see A091409).
The first 5 appears around term 10^(10^23).
We believe that for all N >= 6, the first time N appears is at about position 2^(2^(3^(4^(5^...^(N-1))))). - N. J. A. Sloane and Allan Wilks, Mar 14 2004
For a similar formula, see p. 6 of Levi van de Pol article. - Levi van de Pol, Feb 06 2023
In the first 100000 terms the fraction of [1's, 2's, 3's, 4's] seems to converge, to about [.287, .530, .179, .005] respectively. - Allan Wilks, Mar 04 2004
When k=12 is reached, say, it is treated as the number 12, not as 1,2. This is not a base-dependent sequence.
Does this sequence have a finite average? Does anyone know the exact value? - Franklin T. Adams-Watters, Jan 23 2008
Answer: Given that "...the fraction of [1's, 2's, 3's, 4's] seems to converge, to about [.287, .530, .179, .005]..." that average should be the dot product of these vectors, i.e., about 1.904. - M. F. Hasler, Jan 24 2008
Second answer: The asymptotic densities of the numbers exist, and the average is the dot product. See pp. 56-59 of Levi van de Pol article. - Levi van de Pol, Feb 06 2023
Which is the first step with two consecutive 4's? Or the shortest run found so far between two 4's? - Sergio Pimentel, Oct 10 2016
Answer: The first x such that the x-th and (x+1)-th element are 4, is 255895648634818208370064452304769558261700170817472823... ...398081655524438021806620809813295008281436789493636144. See p. 55 of Levi van de Pol article. - Levi van de Pol, Feb 06 2023

References

  • N. J. A. Sloane, Seven Staggering Sequences, in Homage to a Pied Puzzler, E. Pegg Jr., A. H. Schoen and T. Rodgers (editors), A. K. Peters, Wellesley, MA, 2009, pp. 93-110.

Crossrefs

A091412 gives lengths of runs. A091413 gives partial sums.
Generalizations: A094781, A091975, A091976, A092331-A092335.

Programs

  • Haskell
    -- See link.
    
  • Maple
    K:= proc(L)
    local n,m,k,i,b;
    m:= 0;
    n:= nops(L);
    for k from 1 do
      if k*(m+1) > n then return(m) fi;
      b:= L[-k..-1];
      for i from 1 while i*k <= n and L[-i*k .. -(i-1)*k-1] = b do od:
      m:= max(m, i-1);
    od:
    end proc:
    A[1]:= 1:
    for i from 2 to 220 do
      A[i]:= K([seq(A[j],j=1..i-1)])
    od:
    seq(A[i],i=1..220); # Robert Israel, Jul 02 2015
  • Mathematica
    ClearAll[a]; reversed = {a[2]=1, a[1]=1}; blocs[len_] := Module[{bloc1, par, pos}, bloc1 = Take[reversed, len]; par = Partition[ reversed, len]; pos = Position[par, bloc_ /; bloc != bloc1, 1, 1]; If[pos == {}, Length[par], pos[[1, 1]] - 1]]; a[n_] := a[n] = Module[{an}, an = Table[{blocs[len], len}, {len, 1, Quotient[n-1, 2]}] // Sort // Last // First; PrependTo[ reversed, an]; an]; A090822 = Table[a[n], {n, 1, 99}] (* Jean-François Alcover, Aug 13 2012 *)
  • PARI
    A090822(n,A=[])={while(#Ak||break; k=m);A=concat(A,k));A} \\ M. F. Hasler, Aug 08 2018
    
  • Python
    def k(s):
        maxk = 1
        for m in range(1, len(s)+1):
            i, y, kk = 1, s[-m:], len(s)//m
            if kk <= maxk: return maxk
            while s[-(i+1)*m:-i*m] == y: i += 1
            maxk = max(maxk, i)
    def aupton(terms):
        alst = [1]
        for n in range(2, terms+1):
            alst.append(k(alst))
        return alst
    print(aupton(99)) # Michael S. Branicky, Mar 28 2022

A216730 List of "rotten" strings in {2,3}* (in the curling number sense).

Original entry on oeis.org

22, 333, 32323, 323232, 2323232, 3232323, 22322232, 23222322, 23223223, 33233233, 223222322, 223222323, 232223222, 332332332, 2232223222, 2232223223, 2232223232, 2322232223, 2322322322, 2332332332, 3322332233, 3323323323, 22322232223, 22322232232, 22322232322, 22322322232, 22322322322, 22323222322, 23222322232, 23223223223
Offset: 1

Views

Author

Keywords

Comments

The "curling number" k = k(S) of a string of numbers S = s(1), ..., s(m) is defined as follows. Write S as XY^k for strings X and Y (where Y has positive length) and k is maximized, i.e., k = the maximal number of repeating blocks at the end of S.
The "tail length" t(S) of S is defined as follows: start with S and repeatedly append the curling number (recomputing it at each step) until a 1 is reached; t(S) is the number of terms that are appended to S before a 1 is reached.
If a 1 is never reached, set t(S)=oo (the Curling Number Conjecture says this will never happen).
A sequence S in {2,3}* is called "rotten" if either of t(2S) or t(3S) (or both) is strictly less than t(S).
Example: S = 32323 has curling number k=2, so we get 323232; now k=3, so we get 3232323; now k=3, so we get 32323233; now k=2, so we get 323232332; now k=1 so we stop. We added 4 terms before reaching 1, so t(S)=4.
On the other hand, 2S = 232323 only extends to 232323321..., so t(2S)=2 which means S is rotten.

Crossrefs

A093369 a(n) = sum of lengths of strings that can be generated by any starting string of n 2's and 3's that starts with a 2, using the rule described in the Comments lines.

Original entry on oeis.org

1, 6, 14, 42, 98, 242, 552, 1394, 2935, 6471, 14006, 30060, 64223, 136914, 290224, 613509, 1292567, 2717311, 5696864, 11920124, 24889066, 51880008, 107954163, 224305440, 465388743, 964349526, 1995808823, 4125871527, 8520180124, 17577302639, 36228352911
Offset: 1

Views

Author

N. J. A. Sloane, Apr 28 2004

Keywords

Comments

Start with any initial string of n numbers s(1), ..., s(n), with s(1) = 2, other s(i)'s = 2 or 3 (so there are 2^(n-1) starting strings). The rule for extending the string is this:
To get s(i+1), write the string s(1)s(2)...s(i) as xy^k for words x and y (where y has positive length) and k is maximized, i.e. k = the maximal number of repeating blocks at the end of the sequence so far. Then s(i+1) = k if k >=2, but if k=1 you must stop (without writing down the 1).
a(n) = sum of final length of string, summed over all 2^(n-1) starting strings.

Examples

			a(3) = 14: the starting string, final string and length are as follows:
222 2223 4
223 223 3
232 232 3
233 2332 4, for a total of 4+3+3+4 = 14.
		

Crossrefs

Extensions

a(21)-a(31) from Lars Blomberg, Jul 25 2017

A094005 a(n) = sum of lengths of strings that can be generated by any starting string of n 2's and 3's, using the rule described in the Comments lines.

Original entry on oeis.org

2, 11, 30, 82, 199, 480, 1097, 2630, 5828, 12830, 27873, 60071, 128355, 273543, 580149, 1226626, 2584822, 5433676, 11392986, 23838396, 49776503, 103755527, 215904926, 448602871, 930771041, 1928682932, 3991605129, 8251710234, 17040335019, 35154540729, 72456654860, 149208536983
Offset: 1

Views

Author

N. J. A. Sloane, May 31 2004

Keywords

Comments

Start with any initial string of n numbers s(1), ..., s(n), all = 2 or 3 (so there are 2^n starting strings). The rule for extending the string is this:
To get s(i+1), write the string s(1)s(2)...s(i) as xy^k for words x and y (where y has positive length) and k is maximized, i.e., k = the maximal number of repeating blocks at the end of the sequence so far (k is the curling number of s(1)s(2)...s(i)). Then s(i+1) = k if k >=2, but if k=1 you must stop (without writing down the 1).
a(n) = sum of final length of string, summed over all 2^n starting strings.
See A094004 for more terms. - N. J. A. Sloane, Dec 25 2012

Crossrefs

Formula

Equals A216813(n) + n*2^n. - N. J. A. Sloane, Sep 26 2012
A093369 is closely related.

Extensions

a(27)-a(31) from N. J. A. Sloane, Sep 19 2012

A217209 Irregular triangle read by rows: T(n,k) (n>=1, 1 <= k <= A217208(n)) = number of strings of n 2's and 3's having a tail of length k.

Original entry on oeis.org

2, 2, 1, 1, 4, 2, 2, 6, 5, 3, 1, 1, 12, 9, 6, 2, 3, 20, 18, 12, 6, 7, 0, 0, 0, 1, 40, 34, 25, 11, 14, 1, 0, 1, 2, 74, 71, 47, 24, 28, 1, 3, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1
Offset: 1

Views

Author

N. J. A. Sloane, Oct 01 2012

Keywords

Comments

See A217208 or A216730 for definition of tail.

Examples

			Rows 1 through 8 are:
2,
2, 1, 1,
4, 2, 2,
6, 5, 3, 1, 1,
12, 9, 6, 2, 3,
20, 18, 12, 6, 7, 0, 0, 0, 1,
40, 34, 25, 11, 14, 1, 0, 1, 2,
74, 71, 47, 24, 28, 1, 3, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1,
148, 139, 95, 48, 56, 6, 4, 3, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 1, 1,
...
		

Crossrefs

Cf. A217208 (row lengths), A216813 (means), A122536 (first column), A217210 (second column), A216730, A094004, A090822.

A217208 a(n) = (conjectured) length of longest tail that can be generated by a starting string of 2's and 3's of length n before a 1 is reached, using the rule described in the Comments lines.

Original entry on oeis.org

0, 2, 2, 4, 4, 8, 8, 58, 59, 60, 112, 112, 112, 118, 118, 118, 118, 118, 119, 119, 119, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 132, 132, 132, 132, 132, 132, 132, 132, 133, 173, 173, 173, 173
Offset: 1

Views

Author

N. J. A. Sloane, Sep 29 2012; revised Oct 02 2012

Keywords

Comments

Start with an initial string S of n numbers s(1), ..., s(n), all = 2 or 3. The rule for extending the string is this:
To get s(i+1), write the current string s(1)s(2)...s(i) as XY^k for words X and Y (where Y has positive length) and k is maximized, i.e. k = the maximal number of repeating blocks at the end of the sequence so far (k is the "curling number" of the string). Then set s(i+1) = k.
The "tail length" t(S) of S is defined as follows: start with S and repeatedly append the curling number (recomputing it at each step) until a 1 is reached; t(S) is the number of terms that are appended to S before a 1 is reached. If a 1 is never reached, set t(S)=oo .
The "Curling Number Conjecture" is that if one starts with any finite string and repeatedly extends it by appending the curling number k, then eventually one must reach a 1. This has not yet been proved.
The values shown for n >= 49 are only conjectures, because certain assumptions used to cut down the search have not yet been rigorously justified. However, we believe that ALL terms shown are correct.

Examples

			a(3) = 2, using the starting string 3,2,2, which extends to 3,2,2,2,3, of length 5.
a(4) = 4, using the starting string 2,3,2,3, which extends to 2,3,2,3,2,2,2,3 of length 8.
a(8) = 58: start = 23222323, end = 232223232223222322322232223232223222322322232223232223222322322332.
a(22) = 120: start = 2322322323222323223223: see A116909 for trajectory.
		

Crossrefs

a(n) = length of n-th row of A217209.
a(n) = A094004(n) - n.
Showing 1-9 of 9 results.