Write an explicit form

In general for a natural number N and any vector of size 1*(2N+1)2^{N+1}, I need

a[-1, -2] = v[[1]], a[-1, -1] = v[[2]], a[-1, 0] = v[[3]],
a[-1, 1] = v[[4]], a[0, -2] = v[[5]], a[0, -1] = v[[6]],
a[0, 0] = v[[7]], a[0, 1] = v[[8]], a[1,-2] = v[[9]],
a[1, -1] = v[[10]], a[1, 0] = v[[11]], a[1, 1] = v[[12]].....
a[-N,2^(N)-1]=(2N+1)2^{N}-1.


As an example and for N=1, let v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} (or any vector of size 1*12); Now how to assign the values as follows

a[-1, -2] = v[[1]]=1, a[-1, -1] = v[[2]]=2, a[-1, 0] = v[[3]]=3,
a[-1, 1] = v[[4]]=4, a[0, -2] = v[[5]]=5, a[0, -1] = v[[6]]=6,
a[0, 0] = v[[7]]=7, a[0, 1] = v[[8]]=8, a[1,-2] = v[[9]]=9,
a[1, -1] = v[[10]]=10, a[1, 0] = v[[11]]=11, a[1, 1] = v[[12]]=12

• k = 0; Do[ a[i, j] = v[[++k]] , {i, -1, 1} , {j, -2, 1}]; ?? Jun 8, 2017 at 18:21
• alternately compute your sum as a dot product: Dot[Flatten[Table[Sin[2^j x - k], {j, -1, 1}, {k, -2, 1}], 1], v] Jun 8, 2017 at 18:36
• @george2079 thank you so much. Your first code works perfectly. Appreciated! Jun 9, 2017 at 9:35
• I don't know what is mean the up-voted I did. What I meant is that I really appreciated @george2079 suggested code. I hope someone can provide me with the guidelines and policy on how to use the website as I am new to it. Jun 9, 2017 at 13:52

k = 0;