A091787 a(1) = 2. To get a(n+1), write the string a(1)a(2)...a(n) 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 a(n+1) = max(k,2).
2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 3, 4, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 3, 4, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 3, 2, 2
Offset: 1
Keywords
Examples
To get a(2): a(1) = 2 = (2)^1, so k = 1, a(2) = 2. To get a(3): a(1)a(2) = 22 = (2)^2, so a(3) = k = 2. To get a(4): a(1)a(2)a(3) = 222 = (2)^3, so a(3) = k = 3.
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.
Links
- Giovanni Resta, Table of n, a(n) for n = 1..10000
- Fokko J. van de Bult, Dion C. Gijswijt, John P. Linderman, N. J. A. Sloane, and Allan R. Wilks, A Slow-Growing Sequence Defined by an Unusual Recurrence, J. Integer Sequences, Vol. 10 (2007), #07.1.2.
- Benjamin Chaffin, John P. Linderman, N. J. A. Sloane, and Allan R. Wilks, On Curling Numbers of Integer Sequences, arXiv:1212.6102 [math.CO], Dec 25 2012.
- Benjamin Chaffin, John P. Linderman, N. J. A. Sloane, and Allan R. Wilks, On Curling Numbers of Integer Sequences, Journal of Integer Sequences, Vol. 16 (2013), Article 13.4.3.
- N. J. A. Sloane, Seven Staggering Sequences.
- Levi van de Pol, The first occurrence of a number in Gijswijt's sequence, arXiv:2209.04657 [math.CO], 2022.
- Levi van de Pol, The Growth Rate of Gijswijt's Sequence, J. Int. Seq. (2025) Vol. 28, Art. No. 25.4.6. See p. 4.
- Index entries for sequences related to Gijswijt's sequence
Programs
-
PARI
A091787(n, A=[])={while(#A
k||break; k=m); A=concat(A, k)); A} \\ M. F. Hasler, Oct 04 2018 -
Python
from itertools import islice def c(w): for k in range(len(w), 0, -1): for l in range(1, len(w)//k + 1): if w[-k*l:] == w[-l:]*k: return k def agen(): # generator of terms alst, an = [], 2 while True: yield an; alst.append(an); an = max(2, c(alst)) print(list(islice(agen(), 99))) # Michael S. Branicky, Sep 10 2022
Comments