User blog comment:Simplicityaboveall/Extremely Large Numbers 4/@comment-25337554-20160803011316

Even though you refer to SGH, you can't define R function because you do not specify how to count ordinals in base 3. To specify it, you have to write what ordinal comes next after EVERY ordinal.

Also, there are multiple ordinals that gives the same value when put into SGH.