A280514 Index sequence of the reverse block-fractal sequence A003849.
1, 2, 1, 3, 2, 1, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14
Offset: 1
Examples
A003849 = (0,1,0,0,1,0,1,0,0,1,0,0,1,...) = (s(1), s(2), ... ). (init. block #1) = (1); reversal (0) first occurs at s(1), so a(1) = 1; (init. block #2) = (0,1); rev. (1,0) first occurs at s(2), so a(2) = 2; (init. block #3) = (0,1,0); rev. (0,1,0) first occurs at s(1), so a(3) = 1; (init. block #4) = (0,1,0,0); rev. (0,0,1,0) first occurs at s(3), so a(4) = 3.
Links
- Clark Kimberling, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
r = GoldenRatio; t = Table[Floor[(n + 2) #] - Floor[(n + 1) #], {n, 0, 220}] &[ 2 - GoldenRatio] (* A003849 *) u = StringJoin[Map[ToString, t]] breverse[seq_] := Flatten[Last[Reap[NestWhile[# + 1 &, 1, (StringLength[ str = StringTake[seq, Min[StringLength[seq], #]]] == # && ! (Sow[StringPosition[seq, StringReverse[str], 1][[1]][[1]]]) === {}) &]]]]; breverse[u] (* Peter J. C. Moses, Jan 02 2017 *)
Comments