A020903 Lim f(f(...f(n))) where f is the fractal sequence given by f(n)=A002260(n+1).
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, 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, 2, 1, 1, 2
Offset: 1
Keywords
Examples
f=(1,2,1,2,3,1,2,3,4,1,2,3,4,5,1,2,3,4,5,6,...); write n->n1->n2-> to mean n1=f(n), n2=f(n1),... Then 1->1, 2->2, 3->1, 4->2, 5->3->1, 6->1, 7->2, ...
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- C. Kimberling, Fractal sequences
- C. Kimberling, Numeration systems and fractal sequences, Acta Arithmetica 73 (1995) 103-117.
- Wikipedia, Fractal sequence
Programs
-
Maple
f:= proc(n) option remember; local t; t:= floor((sqrt(8*n+1)-1)/2); procname(n+1-t*(t+1)/2) end proc: f(1):= 1: f(2):=2: seq(f(i),i=1..1000); # Robert Israel, Sep 03 2015
-
Mathematica
m[n_] := Floor[(-1 + Sqrt[8 n - 7])/2]; b[n_] := n - m[n] (m[n] + 1)/2; f[n_] := b[n + 1]; Table[m[n], {n, 1, 100}] (*A003056*) Table[f[n], {n, 1, 100}] (*A002260(n+1)*) h[n_] := Nest[f, n, 40] t = Table[h[n], {n, 1, 300}] (* A020903 *) Flatten[Position[t, 1]] (* A191777 *) Flatten[Position[t, 2]] (* A020904 *)
Comments