# How to make the join function join N amount of things?

**URL:** <https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739>\
**Category:** Questions\
**Tags:** desmos-calculator\
**Created:** [June 1, 2026, 5:53pm UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739 "2026-06-01T17:53:12Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Burrito](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@Burrito](https://cl.desmos.com/u/Burrito)\
**Post date:** [June 1, 2026, 5:53pm UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/1 "2026-06-01T17:53:12Z")

</div>

I have a function ( f ) and if you put a number into it it gives a list based on that number. I need a way to put a list in ( L ) and it comes out with a joined version of that list. I know that the i could do join(f(1),f(2),f(3),f(4)…) ect but thats to always changing and very long and tedious. Any ideas?

 ![Screenshot 2026-05-30 at 5.38.44 pm](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/f/ff9478af6c2efe06cf35716a56575fcdd2f22965.png)

---

<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:** [June 1, 2026, 8:43pm UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/2 "2026-06-01T20:43:37Z")

</div>

You can use list comprehension like [this](https://www.desmos.com/calculator/llyvqocwjs).

---

<div class="post-metadata">

**Author:** ![bubu0822](https://avatars.discourse-cdn.com/v4/letter/b/ecae2f/32.png) [@bubu0822](https://cl.desmos.com/u/bubu0822)\
**Post date:** [June 1, 2026, 10:54pm UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/3 "2026-06-01T22:54:44Z")

</div>

I have a really similar problem, where f(n) takes in a list of points, and if they are above the x-axis, and places a square polygon at that point, and if they are below, it places a triangle. I’ve spent hours on this and couldn’t find a solution, as f(n) takes in a list of points, and outputs a separate list of polygons. Save my poor soul please?

---

<div class="post-metadata">

**Author:** ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)\
**Post date:** [June 2, 2026, 12:12pm UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/4 "2026-06-02T12:12:51Z")

</div>

something like this?  
[https://www.desmos.com/calculator/2kubmhk7e9](https://www.desmos.com/calculator/2kubmhk7e9)

---

<div class="post-metadata">

**Author:** ![bubu0822](https://avatars.discourse-cdn.com/v4/letter/b/ecae2f/32.png) [@bubu0822](https://cl.desmos.com/u/bubu0822)\
**Post date:** [June 2, 2026, 12:56pm UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/5 "2026-06-02T12:56:46Z")

</div>

What kind of black magic did you use here- Oh my gosh thank you so much I had pretty much given up all hope for finding this myself. The internet always knows.

---

<div class="post-metadata">

**Author:** ![bubu0822](https://avatars.discourse-cdn.com/v4/letter/b/ecae2f/32.png) [@bubu0822](https://cl.desmos.com/u/bubu0822)\
**Post date:** [June 2, 2026, 8:47pm UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/6 "2026-06-02T20:47:40Z")

</div>

One more problem please… How would I get an arbitrary integer list like i=[4,2,3,1] to output [1…i]? ([1,2,3,4,1,2,1,2,3,1]). It’s like the first problem, but instead of doing the same operation to every index and adding it to the output list, it adds something of different length each time.

---

<div class="post-metadata">

**Author:** ![NTMDev](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/ntmdev/32/7141_2.png) [@NTMDev](https://cl.desmos.com/u/NTMDev)\
**Post date:** [June 4, 2026, 11:28pm UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/7 "2026-06-04T23:28:41Z")

</div>

What do you mean by:

> [@bubu0822](#):
>
> same operation to every index and adding it to the output list

---

<div class="post-metadata">

**Author:** ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)\
**Post date:** [June 5, 2026, 8:16am UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/8 "2026-06-05T08:16:18Z")

</div>

see next post …  
////////

---

<div class="post-metadata">

**Author:** ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)\
**Post date:** [June 5, 2026, 1:04pm UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/9 "2026-06-05T13:04:51Z")

</div>

Ok, I think I understand what you want:

[https://www.desmos.com/calculator/9xpqhwct7v](https://www.desmos.com/calculator/9xpqhwct7v)

the solution relies on recursion.

---

<div class="post-metadata">

**Author:** ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)\
**Post date:** [June 7, 2026, 10:54am UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/10 "2026-06-07T10:54:33Z")

</div>

Just out of curiosity:  
speaking of recursion, it occurred to me that it is actually possible to  
define functions without using any numbers directly, here’s an example:  
[Fibonacci numbers without numbers](https://www.desmos.com/calculator/pbhfe5mweq)

---

<div class="post-metadata">

**Author:** ![NTMDev](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/ntmdev/32/7141_2.png) [@NTMDev](https://cl.desmos.com/u/NTMDev)\
**Post date:** [June 7, 2026, 12:48pm UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/11 "2026-06-07T12:48:23Z")

</div>

Wait thats very cool  
You did it from this right?

```auto
def fib(n):
     if n > 1:
         return fib(n-1) + fib(n-2)
     return 1
```

---

<div class="post-metadata">

**Author:** ![Guzman\_Tierno](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/guzman_tierno/32/6149_2.png) [@Guzman\_Tierno](https://cl.desmos.com/u/Guzman_Tierno)\
**Post date:** [June 7, 2026, 1:04pm UTC](https://cl.desmos.com/t/how-to-make-the-join-function-join-n-amount-of-things/8739/12 "2026-06-07T13:04:02Z")

</div>

yes yes  
\\\\\\\\\\\\ etc
