Skip to main content
deleted 2 characters in body
Source Link
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 118117 bytes

If[#==1,{0,1},#&@@SortBy[(S=Select)[S[Range[0,s=#]~Tuples~2,#<#2&@@#&]Less@@#&],!FreeQ[LinearRecurrence[{1,1},#,s],s]&],Mean]]&

Try it online!Try it online!

#Mathematica, 118 bytes

If[#==1,{0,1},#&@@SortBy[(S=Select)[S[Range[0,s=#]~Tuples~2,#<#2&@@#&],!FreeQ[LinearRecurrence[{1,1},#,s],s]&],Mean]]&

Try it online!

#Mathematica, 117 bytes

If[#==1,{0,1},#&@@SortBy[(S=Select)[S[Range[0,s=#]~Tuples~2,Less@@#&],!FreeQ[LinearRecurrence[{1,1},#,s],s]&],Mean]]&

Try it online!
Post Undeleted by ZaMoC
deleted 52 characters in body
Source Link
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 148118 bytes

(a=Join@@Table[{j,i},{i,#}If[#==1,{j,0,i-1}];d=z=1;If[#==1,#&@@a#&@@SortBy[(S=Select)[S[Range[0,While[d!=#s=#]~Tuples~2,t=1;While[(s=#&@@LinearRecurrence[#<#2&@@#&],!FreeQ[LinearRecurrence[{1,1},a[[z]]#,{t++}])<=#s],d=s];z++];a[[z-1]]])&s]&],Mean]]&

Try it online!Try it online!

#Mathematica, 148 bytes

(a=Join@@Table[{j,i},{i,#},{j,0,i-1}];d=z=1;If[#==1,#&@@a,While[d!=#,t=1;While[(s=#&@@LinearRecurrence[{1,1},a[[z]],{t++}])<=#,d=s];z++];a[[z-1]]])&

Try it online!

#Mathematica, 118 bytes

If[#==1,{0,1},#&@@SortBy[(S=Select)[S[Range[0,s=#]~Tuples~2,#<#2&@@#&],!FreeQ[LinearRecurrence[{1,1},#,s],s]&],Mean]]&

Try it online!
Post Deleted by ZaMoC
Source Link
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 148 bytes

(a=Join@@Table[{j,i},{i,#},{j,0,i-1}];d=z=1;If[#==1,#&@@a,While[d!=#,t=1;While[(s=#&@@LinearRecurrence[{1,1},a[[z]],{t++}])<=#,d=s];z++];a[[z-1]]])&

Try it online!