In[]:=
ReversibleCARules[2,2]={3,5,10,12};ReversibleCARules[2,3]={15,51,85,170,204,240};ReversibleCARules[2,4]={255,3855,3915,11535,13107,13155,14643,21845,43690,50892,52380,52428,54000,61620,61680,65280};ReversibleCARules[2,5]=;ReversibleCARules[3,2]=;ReversibleCARules[3,3]=;ReversibleCARules[4,2]=;
In[]:=
FindInverses[col_,radf_,radr_][set_]:=Map[{#["Rule"],FromDigits[Association[#["Inverses"]]/@Tuples[Reverse@Range[0,col-1],2radr+1],col]}&,Select[Function[{rule},Association["Rule"->rule,"Inverses"->Union[Rule[CellularAutomaton[{rule,col,radf},#][[1+radf;;-1-radf]],#[[radf+radr+1]]]&/@Tuples[Reverse@Range[0,col-1],2(radf+radr)+1]]]]/@set,Length[#["Inverses"]]==(col)^(2radr+1)&]]
In[]:=
IterateFindInverses[col_,radf_][data_]:={Association[{}],data}
In[]:=
IterateFindInverses[col_,radf_][res_,data_]:=Module[{rad=Plus[Replace[Max[Keys[res]],-∞->0],1],next},next=FindInverses[col,radf,rad][data];{If[SameQ[next,{}],res,Append[res,rad->next]],Complement[data,next[[All,1]]]}]
In[]:=
FindAllInverses[col_,rad_][data_]:=With[{parted=First[FixedPoint[IterateFindInverses[col,rad]@@#&,{data}]]},Association[Catenate[KeyValueMap[Function[{rad2,pairs},Map[Rule[{First[#],col,rad},{Last[#],col,rad2}]&,pairs]],parted]]]]
In[]:=
inv21=FindAllInverses[2,1][ReversibleCARules[2,3]]
Out[]=
{15,2,1}{85,2,1},{51,2,1}{51,2,1},{85,2,1}{15,2,1},{170,2,1}{240,2,1},{204,2,1}{204,2,1},{240,2,1}{170,2,1}
k=3 r=1 inverses
In[]:=
inv31=;
In[]:=
Count[Normal[inv31],x_->x_]
Out[]=
82
In[]:=
Cases[Normal[inv31],(x_->x_):>x]
Out[]=
{{146064945221,3,1},{146150920565,3,1},{146351529701,3,1},{146437505045,3,1},{156137884253,3,1},{418034128733,3,1},{1838317645541,3,1},{1838403620885,3,1},{1838604230021,3,1},{1838690205365,3,1},{3097617961347,3,1},{3883186961667,3,1},{3943753520967,3,1},{3943753521669,3,1},{3943753529391,3,1},{3943753530093,3,1},{4215736521711,3,1},{4215736522413,3,1},{4215736530135,3,1},{4215736530837,3,1},{5786907279621,3,1},{5786993254965,3,1},{5787193864101,3,1},{5787193868469,3,1},{5787275237991,3,1},{5787279839445,3,1},{5787279843813,3,1},{7207549529895,3,1},{7207549530597,3,1},{7207549538319,3,1},{7207549539021,3,1},{7207563355785,3,1},{7207563356253,3,1},{7207563356487,3,1},{7348550124175,3,1},{7348563427855,3,1},{7348577761291,3,1},{7348579808427,3,1},{7348582367347,3,1},{7348584414483,3,1},{7358657347197,3,1},{7378803212625,3,1},{7388869492147,3,1},{7388871539283,3,1},{7388871539517,3,1},{7388874098203,3,1},{7388876145105,3,1},{7388876145339,3,1},{7439234155717,3,1},{7439236202853,3,1},{7439238761773,3,1},{7439240808909,3,1},{7449055815591,3,1},{7449313741623,3,1},{7469459600733,3,1},{7469459607051,3,1},{7479159979941,3,1},{7479188638389,3,1},{7479245955285,3,1},{7479274613733,3,1},{7479417905973,3,1},{7479446560053,3,1},{7479446564421,3,1},{7479503879211,3,1},{7479503881317,3,1},{7479518717931,3,1},{7479518721597,3,1},{7479518722299,3,1},{7479525886573,3,1},{7479527933709,3,1},{7479527933943,3,1},{7479530492629,3,1},{7479532530639,3,1},{7479532531341,3,1},{7479532532745,3,1},{7479532533447,3,1},{7479532535397,3,1},{7479532536957,3,1},{7479532537659,3,1},{7479532539063,3,1},{7479532539531,3,1},{7479532539765,3,1}}
In[]:=
ResourceFunction["InteractiveListSelector"][ArrayPlot[CellularAutomaton[#,{{1},0},{50,All}],ColorRules->{0->White,1->Red,2->Blue}]->#&/@%304]
Out[]=
Second Order
Second Order