MultiwayGrowthList[rule_,init_List,t_]:=Last/@NestList[Function[s,{Join[First[s],#],#}&[Complement[Union[Flatten[StringReplaceList[Last[s],rule]]],First[s]]]],{{},init},t]
In[]:=
MultiwayGrowthList[{"A""AB","B""AAA"},{"A"},4]
In[]:=
{{A},{AB},{AAAA,ABB},{AAAAB,AAABA,AABAA,ABAAA,ABBB},{AAAAAAA,AAAABB,AAABAB,AAABBA,AABAAB,AABABA,AABBAA,ABAAAB,ABAABA,ABABAA,ABBAAA,ABBBB}}
Out[]=
allsigs
In[]:=
Out[]=

Initial condition “A”

ParallelMapMonitored[#->TimeConstrained[MultiwayGrowthList[#,{"A"},10],3]&/@EnumerateSubstitutionSystemRules[#,2]&,allsigs]
In[]:=
Out[]=
alllens=Map[First[#]Length/@Last[#]&,%,{2}];
In[]:=
First[alllens]
In[]:=
{{AA}{1,1,0,0,0,0,0,0,0,0,0},{AB}{1,1,0,0,0,0,0,0,0,0,0}}
Out[]=
Counts[Last/@Flatten[alllens]]
In[]:=
Out[]=
{First[#],FindLinearRecurrence[Last[First[#]]],Length[#]}&/@GatherBy[Select[Flatten[alllens],Head[FindLinearRecurrence[Last[#]]]===List&],Last]
In[]:=
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
General
:Further output of FindLinearRecurrence::vector will be suppressed during this calculation.
Out[]=
Length/@MultiwayGrowthList[{"A""AB","B""AAB"},{"A"},12]
In[]:=
{1,1,2,5,13,34,89,233,610,1597,4181,10946,28657}
Out[]=
FindSequenceFunction[%,n]
In[]:=
(5+2
5
)9
n
3
2
-
5
2
+4
5
n
3
2
-
5
2
+
n
3
2
+
5
2
5(9+4
5
)
Out[]=
FullSimplify[%]
In[]:=
1
5
-n
2
(5-2
5
)
n
(3+
5
)
+
n
(3-
5
)
(5+2
5
)
Out[]=
FindLinearRecurrence[%181]
In[]:=
{3,-1}
Out[]=
LinearRecurrence[{3,-1},{1,1},n]
In[]:=
LinearRecurrence[{3,-1},{1,1},n]
Out[]=
If[Head[#]===Plus&&Length[#]>5,None,#]&@Expand[InterpolatingPolynomial[Range[10]^2,n]]
In[]:=
2
n
Out[]=
{First[#],If[Head[#]===Plus&&Length[#]>5,None,#]&@Expand[InterpolatingPolynomial[Last[First[#]],n]],Length[#]}&/@GatherBy[Select[Flatten[alllens],Head[FindLinearRecurrence[Last[#]]]=!=List&],Last]
In[]:=
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
General
:Further output of FindLinearRecurrence::vector will be suppressed during this calculation.
InterpolatingPolynomial
:List expected at position 1 in InterpolatingPolynomial[$Aborted,n].
Out[]=
Counts[#[[2]]&/@%187]
In[]:=
None200,InterpolatingPolynomial[$Aborted,n]1
Out[]=
MultiwayGrowthList[{"A""AAB"},{"A"},5]
In[]:=
{{A},{AAB},{AAABB,AABAB},{AAAABBB,AAABABB,AAABBAB,AABAABB,AABABAB},{AAAAABBBB,AAAABABBB,AAAABBABB,AAAABBBAB,AAABAABBB,AAABABABB,AAABABBAB,AAABBAABB,AAABBABAB,AABAAABBB,AABAABABB,AABAABBAB,AABABAABB,AABABABAB},{AAAAAABBBBB,AAAAABABBBB,AAAAABBABBB,AAAAABBBABB,AAAAABBBBAB,AAAABAABBBB,AAAABABABBB,AAAABABBABB,AAAABABBBAB,AAAABBAABBB,AAAABBABABB,AAAABBABBAB,AAAABBBAABB,AAAABBBABAB,AAABAAABBBB,AAABAABABBB,AAABAABBABB,AAABAABBBAB,AAABABAABBB,AAABABABABB,AAABABABBAB,AAABABBAABB,AAABABBABAB,AAABBAAABBB,AAABBAABABB,AAABBAABBAB,AAABBABAABB,AAABBABABAB,AABAAAABBBB,AABAAABABBB,AABAAABBABB,AABAAABBBAB,AABAABAABBB,AABAABABABB,AABAABABBAB,AABAABBAABB,AABAABBABAB,AABABAAABBB,AABABAABABB,AABABAABBAB,AABABABAABB,AABABABABAB}}
Out[]=
Length/@%
In[]:=
{1,1,2,5,14,42}
Out[]=
Length/@MultiwayGrowthList[{"A""AAB"},{"A"},10]
In[]:=
{1,1,2,5,14,42,132,429,1430,4862,16796}
Out[]=
FindSequenceFunction[%,n]
In[]:=
-1+n
4
Pochhammer
1
2
,-1+n
Pochhammer[2,-1+n]
Out[]=
FullSimplify[%]
In[]:=
-1+n
4
Pochhammer
1
2
,-1+n
Gamma[1+n]
Out[]=
FullSimplify[%,n∈Integers&&n>0]
In[]:=
-1+n
4
Pochhammer
1
2
,-1+n
n!
Out[]=
DiscreteAsymptotic
-1+n
4
Pochhammer
1
2
,-1+n
n!
,{n,Infinity,2}
In[]:=
-1+n
4
3
8
5/2
n
π
+
1
3/2
n
π
Out[]=
#[[1,2]]&/@%187
In[]:=
Out[]=
ParallelMapMonitored[#->FindSequenceFunction[#,TimeConstraint1]&,%]
In[]:=
FindSequenceFunction::list:List expected at position 1 in FindSequenceFunction[$Aborted,TimeConstraint1].
(kernel 67)
FindSequenceFunction
:List expected at position 1 in FindSequenceFunction[$Aborted,TimeConstraint1].
$Aborted
Out[]=
ParallelMapMonitored[#TimeConstrained[FindSequenceFunction[#,TimeConstraint1],1]&,Take[%205,50]]
In[]:=
FindSequenceFunction::list:List expected at position 1 in FindSequenceFunction[$Aborted,TimeConstraint1].
(kernel 63)
FindSequenceFunction
:List expected at position 1 in FindSequenceFunction[$Aborted,TimeConstraint1].
Out[]=

ABA init

lensaba=ParallelMapMonitored[#->TimeConstrained[Length/@MultiwayGrowthList[#,{"ABA"},10],1]&/@EnumerateSubstitutionSystemRules[#,2]&,allsigs];
In[]:=
{First[#],FindLinearRecurrence[Last[First[#]]],Length[#]}&/@GatherBy[Select[Flatten[alllens],Head[FindLinearRecurrence[Last[#]]]===List&],Last]
In[]:=
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
General
:Further output of FindLinearRecurrence::vector will be suppressed during this calculation.
Out[]=
{First[#],If[Head[#]===Plus&&Length[#]>5,None,#]&@Expand[InterpolatingPolynomial[Last[First[#]],n]],Length[#]}&/@GatherBy[Select[Flatten[alllens],Head[FindLinearRecurrence[Last[#]]]=!=List&],Last]
In[]:=
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
FindLinearRecurrence
:Argument $Aborted at position 1 is not a non-empty vector.
General
:Further output of FindLinearRecurrence::vector will be suppressed during this calculation.
InterpolatingPolynomial
:List expected at position 1 in InterpolatingPolynomial[$Aborted,n].
Out[]=
Expand[InterpolatingPolynomial[Length/@MultiwayGrowthList[{"A""AB"},{#},10],n]]&/@StringTuples["AB",3]
In[]:=

n
2
+
2
n
2
,n,n,1,n,1,1,11-
55991n
2520
+
325421
2
n
16800
-
1748357
3
n
181440
+
1102859
4
n
362880
-
22009
5
n
34560
+
15553
6
n
172800
-
1027
7
n
120960
+
31
8
n
60480
-
13
9
n
725760
+
10
n
3628800

Out[]=
Expand[InterpolatingPolynomial[Length/@MultiwayGrowthList[{"A""AB"},{#},10],n]]&/@StringTuples["AB",2]
In[]:=
n,1,1,11-
55991n
2520
+
325421
2
n
16800
-
1748357
3
n
181440
+
1102859
4
n
362880
-
22009
5
n
34560
+
15553
6
n
172800
-
1027
7
n
120960
+
31
8
n
60480
-
13
9
n
725760
+
10
n
3628800

Out[]=
FindLinearRecurrenceEquation[spec_,func_:a,var_:n]:=func[var+Length[spec]]Total[specfunc/@(var+Range[0,Length[spec]-1])]
LinearRecurrenceEquation[{1,1}]
In[]:=
a[2+n]a[n]+a[1+n]
Out[]=
FindLinearRecurrence[{1,3,4,7,11,18,29,47,76}]
In[]:=
{1,1}
Out[]=
{a[n]a[n-1]+a[n-2],a[1]1,a[2]3}