Find the sum of all positive rational numbers that are less than 5, and that have a denominator of 30 when written in lowest terms.
Not quite sure if I understand your question, but here is something to look at:
listforeach(n, (1, 7, 11, 13, 17, 19, 23, 29), c=n/30
SUM = (1 / 30, 7 / 30, 11 / 30, 13 / 30, 17 / 30, 19 / 30, 23 / 30, 29 / 30) = 4