In[]:=
2+2
Out[]=
4
In[]:=
cfCTQueueHalting=FunctionCompile[Function[{Typed[rules,"ListArray"["PackedArray"["MachineInteger",1]]],Typed[init,"PackedArray"["MachineInteger",1]],Typed[t,"MachineInteger"]},Module[{res=0,q=CreateDataStructure["Queue"]},Scan[q["Push",#]&,init];Do[If[q["Length"]<1,res=tt;Break[],If[q["Pop"]≠0,Scan[q["Push",#]&,rules[[tt-Length[rules]*Quotient[tt-1,Length[rules]]]]]]],{tt,t}];res]]];
In[]:=
Now
Out[]=
In[]:=
cfCTQueueHalting[{{0,1},{0},{0,1,1}},IntegerDigits[7655,2,13],10^7]//AbsoluteTiming
Out[]=
{0.599961,0}
In[]:=
cfCTQueueHalting[{{0,1},{0},{0,1,1}},IntegerDigits[7655,2,13],10^8]//AbsoluteTiming
Out[]=
{6.51298,0}
In[]:=
cfCTQueueHalting[{{0,1},{0},{0,1,1}},IntegerDigits[7655,2,13],10^11]//AbsoluteTiming
Out[]=
{714.358,10805957330}
In[]:=
Now
Out[]=
In[]:=
NotebookSave[]
In[]:=
cfCTQueueHalting[{{0,1},{0},{0,1,1}},IntegerDigits[7655,2,13],10^12]//AbsoluteTiming
Out[]=
{709.928,10805957330}
In[]:=
Now
Out[]=
In[]:=
NotebookSave[]
In[]:=
cfCTQueueHalting[{{0,1},{0},{0,1,1}},IntegerDigits[7655,2,13],10^13]//AbsoluteTiming
Out[]=
{711.433,10805957330}
In[]:=
Now
Out[]=
In[]:=
NotebookSave[]
Out[]=
1
5
(-1+5
)-Ceiling-Ceiling
n
2
1+n
2
2
1+
5
Ceiling
n
2
2
1+
5
5
Ceiling
n
2
2
1+
5
3+Ceiling+Ceiling
n
2
1+n
2
2
-Ceiling-Ceiling
n
2
1+n
2
(1+
5
)2+Ceiling+Ceiling
n
2
1+n
2
2
5
-Ceiling-Ceiling
n
2
1+n
2
(1+
5
)2+Ceiling
1+n
2
2
-Ceiling
1+n
2
(1+
5
)1+Ceiling
1+n
2
2
5
-Ceiling
1+n
2
(1+
5
)-Ceiling-Ceiling
n
2
1+n
2
1
2
5
)
|
5
-Ceiling-Ceiling
n
2
1+n
2
1
2
5
)
|
In[]:=
FullSimplify[%,n>3]
Out[]=
-23-9(7+3(11+5[1+n]
5
+Ceiling
1+n
2
(1+
1
2
5
)5
)+Ceiling
n
2
(1+
1
2
5
)5
)-(-1+5
)5+
5
In[]:=
Sum[Fibonacci[Ceiling[i/2+2]],{i,1,n,2}]+Sum[Fibonacci[Ceiling[i/2+2]],{i,2,n,2}]
Out[]=
-+
4-(-1+(5+2(29+13
-3-Floor
n
2
(-1-
5
)Floor
n
2
2
5
)-6Floor
n
2
(-1-
5
)5
)+Floor
n
2
-
1
2
2Floor
n
2
(1+
5
)5
)5
-3(15+7(38+17
5
)+1+Ceiling
1-n
2
2
-Ceiling
1-n
2
(1+
5
)5
)+(-1+5
)Ceiling
1-n
2
(1+
1
2
5
)πCeiling
1-n
2
15+7
5
In[]:=
FullSimplify[%,n>3]
Out[]=
1
10
5
)Ceiling
1-n
2
1
2
5
)5
)Floor
n
2
-
2
1+
5
Floor
n
2
1
2
5
)5
)+Ceiling
1-n
2
1
2
5
)5
)In[]:=
dbp=Flatten[DeBruijnSequence[{{0,0},{1,1,0,1}},25]];
In[]:=
ParallelTable[With[{case=SortBy[Tally[Partition[dbp,k,1,1]],{Last[#],First[#]}&]},With[{div=Last[First[case]]},{First[Last[#]],Length[First[#]]}&/@(Transpose/@SplitBy[{#[[1]],#[[2]]/div}&/@case,Last])]],{k,2,24}]