WOLFRAM NOTEBOOK

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[]:=
RGraphAddOne[{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;f[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]->Directive[Dotted,Red]}]
In[]:=
RSequenceAdd[{a_,b_,c_},init_List,max_]:=Last[Reap[Module[{f},f[n_]:=f[n]=a+f[Sow[n-bf[Sow[n-c,n->2]],n->1]];(f[#[[1]]]=#[[2]])&/@init;f[max]],_,q]]
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[]:=
RValuesAddOne[{a_,b_,c_},init_List,max_]:=Module[{f},f[n_]:=f[n]=a+f[n-bf[n-c]];(f[#[[1]]]=#[[2]])&/@init;f[max]]
In[]:=
RNestAdd[{a_,b_,c_},init_List,max_,lim_]:=With[{rules=Flatten[{(f[#[[1]]]->#[[2]])&/@init,f[n_Integer]->a+f[Sow[n-bf[Sow[n-c,n->2]],n->1]]}]},FixedPointList[#/.rules&,f[max],lim]]
f[n]==1+f[n-f[n-3]]
In[]:=
RGraphAdd[{1,1,3},{n_/;n<1->1},40,True,True]
Out[]=
In[]:=
RGraphAddOne[{1,1,3},{n_/;n<1->1},10,True,True]
Out[]=
In[]:=
Table[RGraphAddOne[{1,1,3},{n_/;n<1->1},m,True,True],{m,8}]
Out[]=
,
,
,
,
,
,
,
In[]:=
Table[RGraphAddOne[{1,1,3},{n_/;n<1->1},m,True,False],{m,20}]
Out[]=
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
[[[ Look at vertex stratify to get array of values “found so far” ]]]

Scanning Rules

Zero Initial Conditions

How Far Back Do They Look?

The case b=1 has limited lookback because it goes one step at a time........

The Add-Add Case

TraceGraph and Call Graphs (uncached)

Studying 3,1,2

Note these are all fairly small position values .... i.e. we did not capture the large values....
i.e. the s-th maximum is just 3 s + 1
This is the value at the s-th maximum....

Different init

This is a failure to halt.....

General Questions

If f[n] always less than n ? Or at least asymptotically.

Universality

Can we set up values for f[n] with n < 1 so that f[m] with m > XXX corresponds to any possible function?
E.g. if the negative values are {-1,7,8,1,2,4,2} then f[m] will Boole[PrimeQ[m]] (let’s say)
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.