Is there a way to generate n
numbers whose space between them grows incrementally and which that space varies between a min value and a max value? It's not important the domain of these numbers.
Is there a way to generate n numbers whose space between them grows incrementally and which that space varies between a min value and a max value? It's not important the domain of these numbers.
I immagine to create a procedure like this:
const serie = computeSerie(n, minSpace, maxSpace)
// domain is not important, for example [1, +infinity] but also [0, 1], what you prefer
const serie1 = computeSerie(5, 1, 1) // [1, 2, 3, 4, 5]
const serie2 = computeSerie(5, 2, 2) // [1, 3, 5, 7, 9]
const serie3 = computeSerie(5, 1, 4) // [1, ...] I don't know, I suppose to use a pow math function (?)
const serie4 = computeSerie(7, 1, 6) // [1, 2, 4, 8, 13, 18, 24] I don't know if it is the right sequence
I need a sequence that visually is similar to:
Visually:
serie1: |-|-|-|-|
serie2: |--|--|--|--|
serie3: |-|???|--|
serie4: |-|--|---|----|-----|------|
as you can see, serie4 is something that grows and the first distance is 1, the last one is 6 and in total it includes 7 numbers.
I've no idea what is the logic behind. Which is the best way (or simply a way) to create a sequence of number whose distance between them grows and with a fixed min and max distance?