Skip to main content
added 92 characters in body
Source Link
Edmund
  • 43.2k
  • 3
  • 53
  • 148

You may use QuotientRemainder with FromLetterNumber and a bit of recursion.

ClearAll[baseAlphabetForm]
SetAttributes[baseAlphabetForm, Listable];
baseAlphabetForm[expr_Integer?NonNegative] :=
  If[
  expr == 0
  , ""
  , Module[
   {q, r}
   , {q, r} = QuotientRemainder[expr, 26]
   ; If[r == 0, (q -= 1; r = 26;)]
   ; StringJoin[{baseAlphabetForm[q], ToUpperCase@FromLetterNumber[r]}]
     ]
   ]

Then

baseAlphabetForm[10]
"J"

and

baseAlphabetForm[{7288884863, 1844844242797219}]
{"WOLFRAM", "MATHEMATICA"}
baseAlphabetForm[{6500564,3472301,129693,17311,562,6500564,3472301,8262,17311, 81056}]

and

baseAlphabetForm[Range[100]] //
 Multicolumn[#, Frame -> All, Appearance -> "Horizontal"] &

Mathematica graphics

Hope this helps.

You may use QuotientRemainder with FromLetterNumber and a bit of recursion.

ClearAll[baseAlphabetForm]
SetAttributes[baseAlphabetForm, Listable];
baseAlphabetForm[expr_Integer?NonNegative] :=
  If[
  expr == 0
  , ""
  , Module[
   {q, r}
   , {q, r} = QuotientRemainder[expr, 26]
   ; If[r == 0, (q -= 1; r = 26;)]
   ; StringJoin[{baseAlphabetForm[q], ToUpperCase@FromLetterNumber[r]}]
     ]
   ]

Then

baseAlphabetForm[10]
"J"

and

baseAlphabetForm[{7288884863, 1844844242797219}]
{"WOLFRAM", "MATHEMATICA"}

and

baseAlphabetForm[Range[100]] //
 Multicolumn[#, Frame -> All, Appearance -> "Horizontal"] &

Mathematica graphics

Hope this helps.

You may use QuotientRemainder with FromLetterNumber and a bit of recursion.

ClearAll[baseAlphabetForm]
SetAttributes[baseAlphabetForm, Listable];
baseAlphabetForm[expr_Integer?NonNegative] :=
  If[
  expr == 0
  , ""
  , Module[
   {q, r}
   , {q, r} = QuotientRemainder[expr, 26]
   ; If[r == 0, (q -= 1; r = 26;)]
   ; StringJoin[{baseAlphabetForm[q], ToUpperCase@FromLetterNumber[r]}]
     ]
   ]

Then

baseAlphabetForm[10]
"J"

and

baseAlphabetForm[{7288884863, 1844844242797219}]
{"WOLFRAM", "MATHEMATICA"}
baseAlphabetForm[{6500564,3472301,129693,17311,562,6500564,3472301,8262,17311, 81056}]

and

baseAlphabetForm[Range[100]] //
 Multicolumn[#, Frame -> All, Appearance -> "Horizontal"] &

Mathematica graphics

Hope this helps.

added 15 characters in body
Source Link
Edmund
  • 43.2k
  • 3
  • 53
  • 148

You may use QuotientRemainder with FromLetterNumber and a bit of recursion.

ClearAll[baseAlphabetForm]
SetAttributes[baseAlphabetForm, Listable];
baseAlphabetForm[expr_Integer?NonNegative] :=
  If[
  expr == 0
  , ""
  , Module[
   {q, r}
   , {q, r} = QuotientRemainder[expr, 26]
   ; If[r == 0, (q -= 1; r = 26;)]
   ; StringJoin[{baseAlphabetForm[q], ToUpperCase@FromLetterNumber[r]}]
     ]
   ]

Then

baseAlphabetForm[10]
"J"

and

baseAlphabetForm[1000000]baseAlphabetForm[{7288884863, 1844844242797219}]
"BDWGN"{"WOLFRAM", "MATHEMATICA"}

and

baseAlphabetForm[Range[100]] //
 Multicolumn[#, Frame -> All, Appearance -> "Horizontal"] &

Mathematica graphics

Hope this helps.

You may use QuotientRemainder with FromLetterNumber and a bit of recursion.

ClearAll[baseAlphabetForm]
SetAttributes[baseAlphabetForm, Listable];
baseAlphabetForm[expr_Integer?NonNegative] :=
  If[
  expr == 0
  , ""
  , Module[
   {q, r}
   , {q, r} = QuotientRemainder[expr, 26]
   ; If[r == 0, (q -= 1; r = 26;)]
   ; StringJoin[{baseAlphabetForm[q], ToUpperCase@FromLetterNumber[r]}]
     ]
   ]

Then

baseAlphabetForm[10]
"J"

and

baseAlphabetForm[1000000]
"BDWGN"

and

baseAlphabetForm[Range[100]] //
 Multicolumn[#, Frame -> All, Appearance -> "Horizontal"] &

Mathematica graphics

Hope this helps.

You may use QuotientRemainder with FromLetterNumber and a bit of recursion.

ClearAll[baseAlphabetForm]
SetAttributes[baseAlphabetForm, Listable];
baseAlphabetForm[expr_Integer?NonNegative] :=
  If[
  expr == 0
  , ""
  , Module[
   {q, r}
   , {q, r} = QuotientRemainder[expr, 26]
   ; If[r == 0, (q -= 1; r = 26;)]
   ; StringJoin[{baseAlphabetForm[q], ToUpperCase@FromLetterNumber[r]}]
     ]
   ]

Then

baseAlphabetForm[10]
"J"

and

baseAlphabetForm[{7288884863, 1844844242797219}]
{"WOLFRAM", "MATHEMATICA"}

and

baseAlphabetForm[Range[100]] //
 Multicolumn[#, Frame -> All, Appearance -> "Horizontal"] &

Mathematica graphics

Hope this helps.

Source Link
Edmund
  • 43.2k
  • 3
  • 53
  • 148

You may use QuotientRemainder with FromLetterNumber and a bit of recursion.

ClearAll[baseAlphabetForm]
SetAttributes[baseAlphabetForm, Listable];
baseAlphabetForm[expr_Integer?NonNegative] :=
  If[
  expr == 0
  , ""
  , Module[
   {q, r}
   , {q, r} = QuotientRemainder[expr, 26]
   ; If[r == 0, (q -= 1; r = 26;)]
   ; StringJoin[{baseAlphabetForm[q], ToUpperCase@FromLetterNumber[r]}]
     ]
   ]

Then

baseAlphabetForm[10]
"J"

and

baseAlphabetForm[1000000]
"BDWGN"

and

baseAlphabetForm[Range[100]] //
 Multicolumn[#, Frame -> All, Appearance -> "Horizontal"] &

Mathematica graphics

Hope this helps.