login
The n-th group (n>=0) of 9 consecutive terms are the entries, read by rows, of the 3 X 3 matrix A[n], where A[0]= [[0,1,1],[1,1,2],[1,2,4]], A[1]=[[1,1,2],[1,1,2],[2,4,7]] and A[n]=A[n-A[n-1](1,1)] + A[n-A[n-2](1,2)], (M(i,j) denotes the (i,j)-entry of the matrix M).
0

%I #10 Dec 15 2016 01:26:16

%S 0,1,1,1,1,2,1,2,4,1,1,2,1,1,2,2,4,7,2,2,4,2,2,4,4,8,14,3,3,6,3,3,6,6,

%T 12,21,3,3,6,3,3,6,6,12,21,4,4,8,4,4,8,8,16,28,5,5,10,5,5,10,10,20,35,

%U 5,5,10,5,5,10,10,20,35,6,6,12,6,6,12,12,24,42,6,6,12,6,6,12,12,24,42,6,6

%N The n-th group (n>=0) of 9 consecutive terms are the entries, read by rows, of the 3 X 3 matrix A[n], where A[0]= [[0,1,1],[1,1,2],[1,2,4]], A[1]=[[1,1,2],[1,1,2],[2,4,7]] and A[n]=A[n-A[n-1](1,1)] + A[n-A[n-2](1,2)], (M(i,j) denotes the (i,j)-entry of the matrix M).

%C A 3 X 3 matrix Hofstadter type sequence.

%e We have A[1](1,1)=1, A[0](1,2)=1 and so A[2]=A[2-1]+A[2-1]=2A[1], a matrix with entries (2,2,4,2,2,4,4,8,14), yielding the 19th,20th,...,27th terms of the sequence.

%p with(linalg): A[0]:=matrix(3,3,[0,1,1,1,1,2,1,2,4]): A[1]:=matrix(3,3,[1,1,2,1,1,2,2,4,7]): for n from 2 to 10 do A[n]:=evalm(A[n-A[n-1][1,1]]+A[n-A[n-2][1,2]]) od: seq(seq(seq(A[k][i,j],j=1..3),i=1..3),k=0..10);

%t Clear[A] (* Hofstadter 3 X 3 Matrix sequence*) digits=50 A[n_]:=A[n]=A[n-A[n-1][[1, 1]]]+A[n-A[n-2][[1, 2]]]; A[0]:={{0, 1, 1}, {1, 1, 2}, {1, 2, 4}}; A[1]:={{1, 1, 2}, {1, 1, 2}, {2, 4, 7}}; (* flattened sequence of 3 X 3 matrices made with a Hofstadter recurrence*) b=Flatten[Table[A[n], {n, 0, digits}]] ListPlot[b, PlotJoined->True]

%K nonn

%O 0,6

%A _Roger L. Bagula_, Aug 30 2004

%E Edited by _N. J. A. Sloane_, May 13 2006