ClearAll[MakeLengthFive, MayanNumeral] MakeLengthFive[ci_String] := Module[{c}, c = If[EvenQ[StringLength[ci]], ci <> " ", ci]; While[StringLength[c] < 5, c = " " <> c <> " "]; c ] MayanNumeral[n_Integer?Positive] := Module[{nums, q, r, c}, nums = IntegerDigits[n, 20]; Row[Table[ {q, r} = QuotientRemainder[m, 5]; If[{q, r} =!= {0, 0}, c = Prepend[ConstantArray["-----", q], StringJoin[ConstantArray[".", r]]]; c = Join[ConstantArray["", 4 - Length[c]], c]; c , c = {"", "", "", "\[Theta]"} ]; Column[MakeLengthFive /@ c, Frame -> True] , {m, nums} ], Spacer[1]] ] MayanNumeral[4005] MayanNumeral[8017] MayanNumeral[326205] MayanNumeral[886205] MayanNumeral[1337]