# Assign a list of sums to indexed variables

I want to generate a list of sums {a, b, c, d, ..., z}

and assign them to a list of variables such that

b[1] = a

b[2] = b

b[3] = c

...

b[26] = z

-

Presuming your list of sums is a list of numbers -- for example something like what the following generates

SeedRandom[42]; sums = RandomReal[100., 26]


then

Evaluate[Array[b, 26]] = sums;


will do it. You can check that the assignments have all been made as requested by evaluating

Table[b[i], {i, 26}] == sums


True

You can also view them directly

DownValues[b]


-
Clear[b];

Evaluate[Array[b, 26]] = CharacterRange["a", "z"];


-
Array[(b[#] = FromCharacterCode[# + 96]) &, 26]

-

Unless there are other needs, I'll consider using a single "variable" bl and assign your whole list to it

bl = {a, b, ... }


You can of course access every single element of the list with Part (i.e. double braket)

bl[[1]]

a


Often using a single "variable" offer more opportunities in subsequent computations.

-