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.
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
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
- N. J. A. Sloane, Table of n, a(n) for n = 1..24000
- Andreas Abel and Andres Loeh, Haskell program
- 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.
- Benjamin Chaffin and N. J. A. Sloane, The Curling Number Conjecture, preprint.
- Dion C. Gijswijt, Krulgetallen, Pythagoras, 55ste Jaargang, Nummer 3, Jan 2016, (Article in Dutch about this sequence, see pages 10-13, cover and back cover).
- 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. 2.
- N. J. A. Sloane, Seven Staggering Sequences.
- N. J. A. Sloane, Confessions of a Sequence Addict (AofA2017), slides of invited talk given at AofA 2017, Jun 19 2017, Princeton. Mentions this sequence.
- Index entries for sequences related to Gijswijt's sequence
- Index entries for sequences related to curling numbers
Crossrefs
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(#A
k||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
Comments