# Symbolics: how do I create an array of subscripted symbolic variables?

**URL:** <https://discourse.julialang.org/t/symbolics-how-do-i-create-an-array-of-subscripted-symbolic-variables/85530>\
**Category:** General Usage\
**Tags:** polynomials, symbolics\
**Created:** [August 9, 2022, 12:31pm UTC](https://discourse.julialang.org/t/symbolics-how-do-i-create-an-array-of-subscripted-symbolic-variables/85530 "2022-08-09T12:31:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mendeli](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mendeli](https://discourse.julialang.org/u/mendeli)\
**Post date:** [August 9, 2022, 12:31pm UTC](https://discourse.julialang.org/t/symbolics-how-do-i-create-an-array-of-subscripted-symbolic-variables/85530/1 "2022-08-09T12:31:45Z")

</div>

Is there a way to automatically create an array of subscripted variables given `n` in `Symbolics`?

For the case `n=6`, I would like to do what the code below does without having to type out the variables explicitly.

```julia
using Polynomials, Symbolics

@variables a₂ a₃ a₄ a₅ a₆
a = [0, 0, a₂, a₃, a₄, a₅, a₆]
p = Polynomial(a)

```

From the `Symbolics` docs, it is possible to do something like

```julia
@variables a[1:3]

```

but then I cannot start the array from index 0 or from another arbitrary value, which is what I want so that the index of the array matches the exponent of the monomial. I have managed to do this with `Sympy`, but would like to have the same kind of array with `Symbolics`.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 9, 2022, 1:22pm UTC](https://discourse.julialang.org/t/symbolics-how-do-i-create-an-array-of-subscripted-symbolic-variables/85530/2 "2022-08-09T13:22:25Z")

</div>

Open an issue. This is more of a feature request. We used to have a simple way to do this and it would probably be good to expose it again.

---

<div class="post-metadata">

**Author:** ![mendeli](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mendeli](https://discourse.julialang.org/u/mendeli)\
**Post date:** [August 9, 2022, 6:09pm UTC](https://discourse.julialang.org/t/symbolics-how-do-i-create-an-array-of-subscripted-symbolic-variables/85530/3 "2022-08-09T18:09:58Z")

</div>

Thanks, I made a request at [It would be interesting to be able to create an array of subscripted symbolic variables automatically · Issue #694 · JuliaSymbolics/Symbolics.jl · GitHub](https://github.com/JuliaSymbolics/Symbolics.jl/issues/694)
