From: Dr Bruno Campanini on
I need an algorithm to get such a table:

A
B
..
..
Z
AA
AB
..
..
AZ
BA
BB
..
..
BZ
CA
..
..
ZA
ZB
..
..
ZZ
AAA
AAB
..
..
AAZ
ABA
..
..
ABZ
..
AZA
..
AZZ
BAA
..
ZZZ
AAAA
AAAB
..
..
ZZZZ
AAAAA
AAAAB
..

Any idea?

Bruno

From: Bob Hanlon on
CharacterRange["A", "Z"] // Column

CharacterRange["A", "Z"] //
ToExpression // Column


Bob Hanlon

---- Dr Bruno Campanini <cmpbrn(a)gmail.com> wrote:

=============
I need an algorithm to get such a table:

A
B



From: DC on
Define your digits :

In[2]:= digits = FromCharacterCode[#] & /@ Range[65, 65 + 25]

Out[2]= {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", \
"M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}

Then :

Tuples[digits, {2}] for 2 digits numbers
.....
Tuples[digits, {n}] for n digits numbers


Examples :
In[12]:= Tuples[digits, {2}][[1 ;; 10]]

Out[12]= {{"A", "A"}, {"A", "B"}, {"A", "C"}, {"A", "D"}, {"A",
"E"}, {"A", "F"}, {"A", "G"}, {"A", "H"}, {"A", "I"}, {"A", "J"}}


In[14]:= Tuples[digits, {3}][[-10 ;;]]

Out[14]= {{"Z", "Z", "Q"}, {"Z", "Z", "R"}, {"Z", "Z", "S"}, {"Z",
"Z", "T"}, {"Z", "Z", "U"}, {"Z", "Z", "V"}, {"Z", "Z", "W"}, {"Z",
"Z", "X"}, {"Z", "Z", "Y"}, {"Z", "Z", "Z"}}

-Francesco



On 07/22/2010 10:40 AM, Dr Bruno Campanini wrote:
> I need an algorithm to get such a table:
>
> A
> B
> .
> .
> Z
> AA
> AB
> .
> .
> AZ
> BA
> BB
> .
> .
> BZ
> CA
> .
> .
> ZA
> ZB
> .
> .
> ZZ
> AAA
> AAB
> .
> .
> AAZ
> ABA
> .
> .
> ABZ
> .
> AZA
> .
> AZZ
> BAA
> .
> ZZZ
> AAAA
> AAAB
> .
> .
> ZZZZ
> AAAAA
> AAAAB
> .
>
> Any idea?
>
> Bruno
>

From: Christopher Henrich on
In article <i293lk$m1e$1(a)smc.vnet.net>,
"Dr Bruno Campanini" <cmpbrn(a)gmail.com> wrote:

> I need an algorithm to get such a table:
>
> A
> B
> .
> .
> Z
> AA
> AB
> .
> .
> AZ
> BA
> BB
> .
> .
> BZ
> CA
> .
> .
> ZA
> ZB
> .
> .
> ZZ
> AAA
> AAB
> .
> .
> AAZ
> ABA
> .
> .
> ABZ
> .
> AZA
> .
> AZZ
> BAA
> .
> ZZZ
> AAAA
> AAAB
> .
> .
> ZZZZ
> AAAAA
> AAAAB
> .
>
> Any idea?
>
> Bruno

Here's some code, which can probably be made more elegant. (I translated
it from C++ code.) It assumes that the input is a non-negative integer.

AlphaCode[nn_] := Module[{n, result, next},
n = nn + 1;
result = "";
While[n > 0,
n = n - 1;
next = FromCharacterCode[Mod[n, 26] + ToCharacterCode["A"]];
result = next <> result;
n = Quotient[n, 26]];
result];

--
Christopher J. Henrich
chenrich(a)monmouth.com
http://www.mathinteract.com
"A bad analogy is like a leaky screwdriver." -- Boon

From: Norbert Marxer on
On Jul 22, 11:40 am, "Dr Bruno Campanini" <cmp...(a)gmail.com> wrote:
> I need an algorithm to get such a table:
>
> A
> B
> .
> .
> Z
> AA
> AB
> .
> .
> AZ
> BA
> BB
> .
> .
> BZ
> CA
> .
> .
> ZA
> ZB
> .
> .
> ZZ
> AAA
> AAB
> .
> .
> AAZ
> ABA
> .
> .
> ABZ
> .
> AZA
> .
> AZZ
> BAA
> .
> ZZZ
> AAAA
> AAAB
> .
> .
> ZZZZ
> AAAAA
> AAAAB
> .
>
> Any idea?
>
> Bruno

Hello

You can use:

Table[StringJoin /@ Tuples[FromCharacterCode /@ Range[65, 90],
i], {i,1, 5}] // Flatten // Column;

The output has been suppressed because the output is very large. But
you can check the output using only the letters A, B and C:

Table[StringJoin /@ Tuples[FromCharacterCode /@ Range[65, 67], i],
{i,1, 5}] // Flatten // Column

Note that this produces a list of strings. You can convert the strings
to symbols using ToExpression:

Table[StringJoin /@ Tuples[FromCharacterCode /@ Range[65, 67],
i] // ToExpression, {i, 1, 5}] // Flatten // Column

Best Regards
Norbert Marxer