0

Let $N$ be a natural number $\ge 1$. I have two questions:

  1. How can I define a list with variables $p_1,...,p_n$?
  2. How can I define an element $a\in\mathbb{C}$ such that $a⁶=(-1)^n?$
m_goldberg
  • 107,779
  • 16
  • 103
  • 257

2 Answers2

1

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.

yohbs
  • 7,046
  • 3
  • 29
  • 60
-1

1.

aaa[n_] := Table[Subscript[p, i], {i, n}]

2.

a \[Element] \[DoubleStruckCapitalC]
a^6 = (-1)^N

a[n_] := (-1)^(n/6)
Anxon Pués
  • 907
  • 5
  • 13
  • My mistake, the $N$ from $2.$ should be the same as the $n$ from $1.$. I don't have to tell Mathematica, what $N$ is, i.e. natural and $\ge 1$? – Valerie D. Feb 15 '18 at 14:14