Member-only story
BQN Bolognese

So you understand where BQN comes from and you’ve setup your development environment but you’d like to get better at it? Then you’ve come to the right place.
Today we’ll be looking into solving the first problem of the TryAPL practice problems in BQN.
Seems a Bit Odd To Me
The first problem from 2013 is titled: Seems a Bit Odd To Me
Th problem is basically asking to return a list of the first n odd numbers.
Let’s start with the first n numbers:
↕10
Will return 10 consecutive numbers starting from 0:
⟨ 0 1 2 3 4 5 6 7 8 9 ⟩
What we would like to see is
⟨ 1 3 5 7 9 11 13 15 17 19 ⟩
Which means that we’d have to multiply our initial list with 2 and add 1 to it:
1+2×↕10
Which would return
⟨ 1 3 5 7 9 11 13 15 17 19 ⟩
Of course, the problem is asking us for a generic function and not the first 10 odd numbers. In order to do that, we’d have to put our statement in a function:
Solution ⇐ 1+2×↕
Once we’ve done this, we can call our function as follows:
Solution 10
Which will give us the desired output.