Posted by Jason Polak on 18. September 2015 · Write a comment · Categories: math

Often, in the Sage notebook, if you need a function you can just guess what it might be called. For instance, say I wanted the prime factorisation of 8095897323:

Notice that I use the symbol “>” for the output of a command. But what if I wanted to have the prime factors as a list instead? We could do:


The object returned is a list in Python. Now suppose I just wanted the largest prime factor. We could use Python’s max function:

What could we do with this? Perhaps we could keep track of the maximum prime factor of a number i as i varies from 2 to 2000:

Notice how I didn’t put an output this time. That’s because the output is a graph! That’s what the point command does to the list of points s: it just plots the points on a graph. Here it is:

sage0

Now you can make your own plots involving maximum prime factors!

claimtoken-55fc3dd7f3d62

Leave a Reply

Your email address will not be published. Required fields are marked *