Let $N$ be a natural number $\ge 1$. I have two questions:
- How can I define a list with variables $p_1,...,p_n$?
- How can I define an element $a\in\mathbb{C}$ such that $a⁶=(-1)^n?$
Let $N$ be a natural number $\ge 1$. I have two questions:
For the first question, you can use Table, as Anxon Pués wrote:
Table[Subscript[p, i], {i, n}]
However, this might be a bad choice, as discussed here. A better way is to define them as p[1], p[2],... etc, which can be done either with Table like this
Table[p[i],{i,n}]
or more conveniently with Array like this
Array[p,n]
As for your second question - it's not clear what you mean. There are 6 solutions to the equation you wrote. You can either do Solve[x^6==(-1)^n,x] to get all of them, or if you're using this inside other expressions you might want to use Assumptions->x^6==(-1)^n.
Array[p,n] is doesn't work. Maybe because $n$ is not fixed?
– Valerie D.
Feb 18 '18 at 18:07
1.
aaa[n_] := Table[Subscript[p, i], {i, n}]
2.
a \[Element] \[DoubleStruckCapitalC]
a^6 = (-1)^N
a[n_] := (-1)^(n/6)