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.
%I A094840 #18 Oct 18 2024 06:10:01 %S A094840 1,1,1,1,2,1,2,1,1,2,2,1,2,2,2,1,2,1,1,2,3,1,2,1,1,2,2,1,2,1,2,3,1,1, %T A094840 2,2,2,1,1,2,2,1,2,2,2,1,2,1,1,2,3,1,2,1,1,2,2,1,2,1,2,2,3,1,2,1,1,2, %U A094840 2,1,2,1,2,3,1,1,2,2,2,1,1,2,2,1,2,2,2,1,2,1,1,2,3,1,2,1,1,2,2,1 %N A094840 a(1) = 1; for n > 1, a(n) = curling number of (b(1),...,b(n-1)), where b() = Linus sequence A006345. %C A094840 The curling number of a finite string S = (s(1),...,s(n)) is the largest integer k such that S can be written as xy^k for strings x and y (where y has positive length). %H A094840 F. J. van de Bult, D. C. Gijswijt, J. P. Linderman, N. J. A. Sloane and Allan Wilks, <a href="http://www.cs.uwaterloo.ca/journals/JIS/index.html">A Slow-Growing Sequence Defined by an Unusual Recurrence</a>, J. Integer Sequences, Vol. 10 (2007), #07.1.2. %H A094840 F. J. van de Bult, D. C. Gijswijt, J. P. Linderman, N. J. A. Sloane and Allan Wilks, A Slow-Growing Sequence Defined by an Unusual Recurrence [<a href="http://neilsloane.com/doc/gijs.pdf">pdf</a>, <a href="http://neilsloane.com/doc/gijs.ps">ps</a>]. %H A094840 <a href="/index/Cu#curling_numbers">Index entries for sequences related to curling numbers</a> %p A094840 fd := fopen("b006345.txt",READ) : a006345 := [] : bf := fscanf(fd,"%d %d") : while nops(bf) <> 0 do a006345 := [op(a006345), op(2,bf) ] ; bf := fscanf(fd,"%d %d") ; od: curlN := proc(L) local a,k,klen,Llen,y ; a := 1 ; Llen := nops(L) ; for klen from 1 to floor(Llen/2) do y := op(Llen-klen+1..Llen,L) ; for k from 2 to floor(Llen/klen) do if op(Llen-k*klen+1..Llen-(k-1)*klen,L) = y then if k > a then a := k ; fi ; else break ; fi ; od: od: RETURN(a) ; end: A094840 := proc(n) global a006345 ; if n = 1 then 1; else curlN( [op(1..n-1,a006345)] ) ; fi ; end: for n from 1 to 100 do printf("%d, ",A094840(n)) ; od: # _R. J. Mathar_, Dec 07 2007 %t A094840 nmax = 100; %t A094840 LDS[L_] := Module[{Cands, r, m}, Cands = Range[Floor[Length[L]/2]]; r = 0; For[m = 1, Length[Cands] > 0, m++, Cands = Select[Cands, L[[-m]] == L[[-# - m]]&]; If[Min[Cands] == m, r = m; Cands = ReplaceAll[Cands, m -> Nothing]]]; r]; %t A094840 A = {1}; %t A094840 For[n = 2, n <= nmax, n++, If[LDS[Append[A, 1]] < LDS[Append[A, 2]], A = Append[A, 1], A = Append[A, 2]]]; %t A094840 a006345 = A; %t A094840 curlN[L_] := Module[{a, k, klen, Llen, y}, a = 1; Llen = Length[L]; For[klen = 1, klen <= Floor[Llen/2], klen++, y = L[[Llen - klen + 1 ;; Llen]]; For[k = 2, k <= Floor[Llen/klen], k++, If[L[[Llen - k*klen+1 ;; Llen - (k-1)*klen]] == y, If[k > a, a = k] , Break[]]]]; Return[a]]; %t A094840 A094840[n_] := If [n == 1, 1, curlN[a006345[[1 ;; n-1]]]]; %t A094840 Table[A094840[n], {n, 1, nmax}] (* _Jean-François Alcover_, Oct 18 2024, after Maple programs *) %Y A094840 Cf. A090822, A006345, A093921, A093914. %Y A094840 Cf. A006345. %K A094840 nonn %O A094840 1,5 %A A094840 _N. J. A. Sloane_, May 26 2004