How to represent this with math notatation

  • Context: Undergrad 
  • Thread starter Thread starter moni94
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
9 replies · 3K views
moni94
Messages
8
Reaction score
0
Hi. I have the following pseudocode:

while(n < k)
n = n*a

How do I represent this with mathematical notation (e.g with summation)?
 
Mathematics news on Phys.org
n is arbitrary. We're not writing a program here, I was just using pseudocode to demonstrate the concept.

Oh, and the code is supposed to be:

while(n < k)
n = n + n*a
 
Last edited:
I like Serena said:
Let {ni} be the sequence given by ni+1=ni + ni * a.
Let N be the first number ni such that ni-1 ≤ k and ni > k.

Or:

[tex]\left\lfloor \frac k {n_0 \ln(1 + a)} \right\rfloor[/tex]

Thanks, that's what I needed!
 
Well there's this game where you can spend your money on buildings and each time you buy one the price of that building goes up by 10%. So I wanted to know how you can calculate the total price of the buildings you can buy with a certain amount of money.
 
moni94 said:
Well there's this game where you can spend your money on buildings and each time you buy one the price of that building goes up by 10%. So I wanted to know how you can calculate the total price of the buildings you can buy with a certain amount of money.

Ah, so you mostly needed the final formula?
Please note, that this is the total price of the buildings which is one more than you can buy :wink:.