WOLFRAM NOTEBOOK

Addition Rules

In[]:=
RGraphAdd[{a_,b_,c_},init_List,max_,id_:False,labs_:True]:=Graph[DirectedEdge[#[[1,1]],#[[2,1]],#[[1,2]]]&/@Last[Reap[Module[{f},f[n_]:=f[n]=a+f[Sow[n-bf[If[id,Sow[n-c,(n->2)],n-c]],(n->1)]];(f[#[[1]]]=#[[2]])&/@init;Table[f[n],{n,max}]],_,Rule]],GraphLayout->"LayeredDigraphEmbedding",VertexLabels->If[labs,Placed["Name",Center],None],VertexSize->If[labs,.7,Automatic],VertexStyle->Directive[EdgeForm[Lighter[Blue,.5]],Lighter[Blue,.9]],EdgeStyle->{DirectedEdge[_,_,1]->Blue,DirectedEdge[_,_,2]->Red}]
In[]:=
RValuesAdd[{a_,b_,c_},init_List,max_]:=Module[{f},f[n_]:=f[n]=a+f[n-bf[n-c]];(f[#[[1]]]=#[[2]])&/@init;Table[f[n],{n,max}]]
In[]:=
Table[{a,b,c}->ListLinePlot[RValuesAdd[{a,b,c},{n_/;n<1->1},100],PlotTheme->"Minimal",ImageSize->Tiny],{a,3},{b,3},{c,3}]
Out[]=
{1,1,1}
,{1,1,2}
,{1,1,3}
,{1,2,1}
,{1,2,2}
,{1,2,3}
,{1,3,1}
,{1,3,2}
,{1,3,3}
,{2,1,1}
,{2,1,2}
,{2,1,3}
,{2,2,1}
,{2,2,2}
,{2,2,3}
,{2,3,1}
,{2,3,2}
,{2,3,3}
,{3,1,1}
,{3,1,2}
,{3,1,3}
,{3,2,1}
,{3,2,2}
,{3,2,3}
,{3,3,1}
,{3,3,2}
,{3,3,3}
In[]:=
Table[Labeled[RGraphAdd[{a,b,c},{n_/;n<1->1},40,True,False],{a,b,c}],{a,3},{b,3},{c,3}]
Out[]=
{1,1,1}
,
{1,1,2}
,
{1,1,3}
,
{1,2,1}
,
{1,2,2}
,
{1,2,3}
,
{1,3,1}
,
{1,3,2}
,
{1,3,3}
,
{2,1,1}
,
{2,1,2}
,
{2,1,3}
,
{2,2,1}
,
{2,2,2}
,
{2,2,3}
,
{2,3,1}
,
{2,3,2}
,
{2,3,3}
,
{3,1,1}
,
{3,1,2}
,
{3,1,3}
,
{3,2,1}
,
{3,2,2}
,
{3,2,3}
,
{3,3,1}
,
{3,3,2}
,
{3,3,3}

“Addition-Addition Rules”

Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.