# Repeating a List

**URL:** <https://cl.desmos.com/t/repeating-a-list/617>\
**Category:** Questions\
**Created:** [November 8, 2019, 2:43pm UTC](https://cl.desmos.com/t/repeating-a-list/617 "2019-11-08T14:43:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArmaanS](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/armaans/32/418_2.png) [@ArmaanS](https://cl.desmos.com/u/ArmaanS)\
**Post date:** [November 8, 2019, 2:43pm UTC](https://cl.desmos.com/t/repeating-a-list/617/1 "2019-11-08T14:43:36Z")

</div>

Can you repeat a list N times?

E.g. [1,2,3] repeated 2 times is [1,2,3,1,2,3]

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [November 8, 2019, 4:56pm UTC](https://cl.desmos.com/t/repeating-a-list/617/2 "2019-11-08T16:56:39Z")

</div>

Here’s one. Credit to another user (I don’t remember whom) for concatenating a list. I just added the modular math part to repeatedly use the indices for the original list.

https://www.desmos.com/calculator/g8g9h9blsn?embed

Edit: Since then there’s also list comprehension, but I realized the above use of series notation is unnecesssary.  
https://www.desmos.com/calculator/7e0itlh2y3?embed

---

<div class="post-metadata">

**Author:** ![BleepBloop314](https://avatars.discourse-cdn.com/v4/letter/b/a3d4f5/32.png) [@BleepBloop314](https://cl.desmos.com/u/BleepBloop314)\
**Post date:** [April 29, 2021, 10:22am UTC](https://cl.desmos.com/t/repeating-a-list/617/3 "2021-04-29T10:22:41Z")

</div>

Copy paste this:  
r\_{ep}\left(n\_{umber},l\_{ist}\right)=\sum\_{k=\left[1…n\_{umber}\cdot\operatorname{length}\left(l\_{ist}\right)\right]}^{\left[1…n\_{umber}\cdot\operatorname{length}\left(l\_{ist}\right)\right]}l\_{ist}\left[\operatorname{mod}\left(k-1,\operatorname{length}\left(l\_{ist}\right)\right)+1\right]

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [April 29, 2021, 10:55pm UTC](https://cl.desmos.com/t/repeating-a-list/617/4 "2021-04-29T22:55:23Z")

</div>

Since then, if you don’t need to repeat too many times, you can just use join( ):

```auto
L=[1,2,3]
R=join(L,L,L,L,L)

```

---

<div class="post-metadata">

**Author:** ![Gracemore](https://avatars.discourse-cdn.com/v4/letter/g/3ec8ea/32.png) [@Gracemore](https://cl.desmos.com/u/Gracemore)\
**Post date:** [October 10, 2025, 3:18pm UTC](https://cl.desmos.com/t/repeating-a-list/617/5 "2025-10-10T15:18:23Z")

</div>

As a single function from Daniels answer:  
f\_{repeat}\left(L,n\right)=L\left[\operatorname{mod}\left(\left[0,…n\cdot\operatorname{length}\left(L\right)-1\right],\operatorname{length}\left(L\right)\right)+1\right]

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [October 10, 2025, 3:20pm UTC](https://cl.desmos.com/t/repeating-a-list/617/6 "2025-10-10T15:20:56Z")

</div>

Oh nice! I like that!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/f/f5bd144684474e9a2f333002cde9840e52c5dbd3.png) [@system](https://cl.desmos.com/u/system)\
**Post date:** [October 12, 2025, 3:21pm UTC](https://cl.desmos.com/t/repeating-a-list/617/7 "2025-10-12T15:21:25Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
