Okay, i'm really stuck with that one-liner.
Yet tried to accomplish my task with zip and map, but none of it worked i want. So my question is: can i generate a list with a custom step like this?
>>wicked cool code snippet
>>[101, 105, 109, 115, 121]
The idea behind this is that i have the start of a sequence X equal to 101. Then i add 4, then again adding 4. Then i add 6 to the previous result and again i add 6.
I believe it should look like this mathematically speaking:
An = A1+4d,A2+4d,A3+6d, A4+6d.
UPD
Ok, let me make it more clear.
range(101, 120, 3) <-Classical arithmetical progression
[101, 104, 107, 110, 113, 116, 119] < - The output
What i need is a combination of two of them. Like add +4 to each element n-times, then add +6 to the last element of add 4 sequence n-times.
Hope, it's clearer now.
101and[4, 4, 6, 6]? I want to say fold using addition, except that goes all the way, so you'd have to do it in a range or something. Slightly beyond my brain ATM.zipandmap, some sort of accumulator must be involved.