Farey Sequence implemenatation I'm trying to use the Farey sequence to get the next lowest reduced

Xiomara Poole

Xiomara Poole

Answered question

2022-05-21

Farey Sequence implemenatation
I'm trying to use the Farey sequence to get the next lowest reduced fraction in a list. For example, for n = 8, we have , 1 3 , 3 8 , 2 5 , 3 7 , 1 2 ,
So let's take 3 8 and 2 5 and attempt to get 3 7 .
p = n + b d c a
q = n + b d d b
a = 3 , b = 8 , c = 2 , d = 5 , n = 8
p = [ 8 + 8 5 ] 2 3
q = [ 8 + 8 5 ] 5 8
p q = 3.4 8 3 7
Am I using the equation wrong?

Answer & Explanation

exhumatql

exhumatql

Beginner2022-05-22Added 12 answers

Well, according to your equations, you have to take the floor of n + b d . In your example, it's 8 + 8 5 = 3. Your p is then ( 3 2 ) 3 = 3, and your q is ( 3 5 ) 8 = 7

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?