I'm learning computer programming and I am trying to solve a problem that I think may have an algebraic solution.
I am trying to create a sequence of numbers that starts with adding a number to itself and then taking the result and adding that to itself and so on until the sequence is created.
I need to achieve this with a single-lined expression because I cannot reassign varibles using multiple line of code due to school assignment constraints.
I need to take something like this:
y = x + x
x = y
and turn it into a single lined equation.
Can anybody guide me on this?
Thanks!
It works fine with this: