OFFSET
0,4
FORMULA
A[n_]:=If[(n<33||n>33)&&(n<42||n>45)&&(n<56||n>59), a[[n]].A[n-1], c[[32]].A[n-1]] where A[0] = {{0, 1, 1, 2}, {1, 1, 2, 3}, {1, 2, 3, 4}, {2, 3, 4, 5}};
MATHEMATICA
digits=60
Hofstadter[n_Integer?Positive] :=Hofstadter[n] =Hofstadter[n - Hofstadter[n-1]] + Hofstadter[n - Hofstadter[n-4]] Hofstadter[1] = Hofstadter[2] =1; Hofstadter[3] =2;
Hofstadter[0]= 0; Hofstadter[4]= 3;
n0=4
(* pattern matrices of the chaotic sequence*)
A[k_]=Table[Hofstadter[k+i+j-2], {i, 1, n0}, {j, 1, n0}]
M=Array[f, {n0, n0}]
m1=Flatten[M]
(* linear Markov matrix solutions *)
a=Table[Flatten[M/.Solve[A[n]-M.A[n-1]==0, m1], 1], {n, 1, digits}]; (* function for average matrix calculation*)
ave[n_Integer?Positive] :=ave[n] = (ave[n-1]*(n-1)+a[[n]])/n
ave[1]=a[[1]];
c=Table[ave[n], {n, 1, 32}]; c[[32]]
(* Matrix reconstruction tensors skipping the "bad spots" by substitution of an average matrix*)
B[n_]:=If[(n<33||n>33)&&(n<42||n>45)&&(n<56||n>59), a[[n]].B[n-1], c[[32]].B[n-1]]
B[0] = {{0, 1, 1, 2}, {1, 1, 2, 3}, {1, 2, 3, 4}, {2, 3, 4, 5}};
(* output sequence of the reconstruction*)
b=Flatten[Table[Floor[B[n][[1, 1]]], {n, 0, digits}]]
ListPlot[b, PlotJoined->True, PlotRange->All]
CROSSREFS
KEYWORD
nonn,less,uned
AUTHOR
Roger L. Bagula, Sep 01 2004
STATUS
approved