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 A020903 #27 Apr 09 2016 13:39:36 %S A020903 1,2,1,2,1,1,2,1,2,1,2,1,2,1,1,2,1,2,1,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2, %T A020903 1,1,2,1,2,1,1,2,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,2,1, %U A020903 2,1,1,2 %N A020903 Lim f(f(...f(n))) where f is the fractal sequence given by f(n)=A002260(n+1). %C A020903 Suppose that f(1), f(2), f(3),... is a fractal sequence (a sequence which contains itself as a proper subsequence, such as 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, ...; if the first occurrence of each n is deleted, the remaining sequence is identical to the original; see the Wikipedia article for details). Then for each n>=1, the limit L(n) of composites f(f(f...f(n)...)) exists and is one of the numbers in the set {k : f(k)=k}. If f(2)>2, then L(n)=1 for all n; if f(2)=2 and f(3)>3, then L(n) is 1 or 2 for all n, etc. Examples: A020903, A191770, A191774. %C A020903 Conjecture: a(n) and a(n+1) are never both 2. - _Robert Israel_, Sep 03 2015 %C A020903 From _Michel Dekking_, Apr 09 2016: (Start) %C A020903 Proof of the conjecture: Let f(n)=A002260(n+1)=1,2,1,2,3,1,2,3,4,... Then (f(n)) is a concatenation of ladders 1,2 followed by 1,2,3 followed by 1,2,3,4 etc. The proof is by induction. Note that the sequence (a(n)) can be seen as map from the positive integers to the positive integers. The induction starts from the observation that a(1) and a(2) are not both 2. %C A020903 We use that f(k)<k for all k>2. Any pair (k,k+1) from a ladder has image (a(k),a(k+1)) = (a(f(k)),a(f(k+1))), which occurs either as image of two adjacent integers (j,j+1) earlier in the sequence, and so will not be equal to (2,2) by the induction hypothesis, or as image of a pair (j,1), whose image is also not equal to (2,2). The same holds for a pair consisting of the end of a ladder and the next entry. (End) %H A020903 Robert Israel, <a href="/A020903/b020903.txt">Table of n, a(n) for n = 1..10000</a> %H A020903 C. Kimberling, <a href="http://faculty.evansville.edu/ck6/integer/fractals.html">Fractal sequences</a> %H A020903 C. Kimberling, <a href="http://matwbn.icm.edu.pl/ksiazki/aa/aa73/aa7321.pdf">Numeration systems and fractal sequences</a>, Acta Arithmetica 73 (1995) 103-117. %H A020903 Wikipedia, <a href="http://en.wikipedia.org/wiki/Fractal_sequence">Fractal sequence</a> %e A020903 f=(1,2,1,2,3,1,2,3,4,1,2,3,4,5,1,2,3,4,5,6,...); write %e A020903 n->n1->n2-> to mean n1=f(n), n2=f(n1),... Then %e A020903 1->1, 2->2, 3->1, 4->2, 5->3->1, 6->1, 7->2, ... %p A020903 f:= proc(n) option remember; local t; t:= floor((sqrt(8*n+1)-1)/2); procname(n+1-t*(t+1)/2) end proc: %p A020903 f(1):= 1: f(2):=2: %p A020903 seq(f(i),i=1..1000); # _Robert Israel_, Sep 03 2015 %t A020903 m[n_] := Floor[(-1 + Sqrt[8 n - 7])/2]; %t A020903 b[n_] := n - m[n] (m[n] + 1)/2; f[n_] := b[n + 1]; %t A020903 Table[m[n], {n, 1, 100}] (*A003056*) %t A020903 Table[f[n], {n, 1, 100}] (*A002260(n+1)*) %t A020903 h[n_] := Nest[f, n, 40] %t A020903 t = Table[h[n], {n, 1, 300}] (* A020903 *) %t A020903 Flatten[Position[t, 1]] (* A191777 *) %t A020903 Flatten[Position[t, 2]] (* A020904 *) %Y A020903 Cf. A020904, A191777, A191770, A191774. %K A020903 nonn %O A020903 1,2 %A A020903 _Clark Kimberling_