as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write pseudocode to find all prime numbers up to a given number.
user
// set n to the given number
n = givennumber

// loop from 2 to n
for i = 2 to n
    // set isprime to true
    isprime = true
    
    // loop from 2 to i-1
    for j = 2 to i-1
        // check if i is divisible by j
        if i is divisible by j
            // set isprime to false
            isprime = false
            // break the inner loop
            break
    end
    // if isprime is still true, print i
    if isprime = true
        print(i)
    end 
end
assistant