A107793 Differences between successive indices of 1's in the ternary tribonacci sequence A305390.
4, 5, 3, 5, 4, 5, 4, 5, 3, 5, 4, 5, 5, 4, 5, 3, 5, 4, 5, 3, 5, 4, 5, 5, 4, 5, 3, 5, 4, 5, 4, 5, 3, 5, 4, 5, 5, 4, 5, 3, 5, 4, 5, 4, 5, 3, 5, 4, 5, 5, 4, 5, 3, 5, 4, 5, 3, 5, 4, 5, 5, 4, 5, 3, 5, 4, 5, 4, 5, 3, 5, 4, 5, 5, 4, 5, 3, 5, 4, 5, 5, 4, 5, 3, 5, 4, 5, 4, 5, 3, 5, 4, 5, 5, 4, 5, 3, 5, 4, 5
Offset: 0
Keywords
Programs
-
Maple
# From N. J. A. Sloane, Jun 22 2018. The value 16 can be replaced (in two places) by any number congruent to 1 mod 3. with(ListTools); S := Array(0..30); psi:=proc(T) Flatten(subs( {1=[2], 2=[3], 3=[1,2,3]}, T)); end; S[0]:=[1]; for n from 1 to 16 do S[n]:=psi(S[n-1]): od: # Get differences between indices of 1's in S: Bag:=proc(S) local i,a; global DIFF; a:=[]; for i from 1 to nops(S) do if S[i]=1 then a:=[op(a),i]; fi; od: DIFF(a); end; Bag(S[16]);
-
Mathematica
s[1] = {2}; s[2] = {3}; s[3] = {1, 2, 3}; t[a_] := Flatten[s /@ a]; p[0] = {1}; p[1] = t[p[0]]; p[n_] := t[p[n - 1]] pp = p[13] a = Flatten[Table[If[pp[[j]] == 1, j, {}], {j, 1, Length[pp]}]] b = Table[a[[n]] - a[[n - 1]], {n, 2, Length[a]}]
Extensions
Edited (and checked) by N. J. A. Sloane, Jun 21 2018 (the original version did not make it clear that this is based on only one of the three tribonacci sequences A305389, A305390, A305391).
Comments