Processing math: 100%
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 11 years ago

ensaba gravatar image

Create a sequnce of lowest terms in a range

Hi,

I was wondering if sage has a built in function to generate the number p/q in lowest terms between 0 and 1?

Otherwise, what are the functions I need to use to create such a sequence?

Thank you in advance for any help provided.

click to hide/show revision 2
clarified objective of initial question

Create Plot a sequnce of function involving lowest terms in a rangeterms

Hi,

How do I use sage to plot the following function?

f(x)=[0,x irrational, 0<x<11q,x=pq in lowest term, 0<x<1.

I actually wrote a function that would generate the following sequence: 1n,,n1n for a given n.

Then I created a list of lists that contains the above sequence for each n. After flattening that list, I call the set function on it to remove duplicates. Then I use that to creat a list (x,y) tuple to plot the function using scatter plot.

I was wondering if sage has there is a built in function to generate the number p/q in lowest terms between 0 and 1?

Otherwise, what are the functions I need to use to create such a sequence?

Thank you in advance for any help provided.simpler way of doing this.