(*This Program is designed to generate the order of the Grand Set of rational numbers in the interval I = [1/n, n], whose numerators and denominators are bounded by Fibonacci(n + 1).  The order of this set is 2*Farey(m; I) - 1, where m = Fibonacci(n + 1).  Farey(Fibonacci(n + 1); I) is the Sequence A176501: 1, 2, 4, 9, 19, 50, 122, 317, 837, 2213, 5758, 15236, 40028, 105079, 276627, 727409, 1910685, 5020094, .... The order of the Grand Set is given by the Sequence A176502: 1, 3, 7, 19, 43, 115, 279, 719, 1879, 4911, 12659, 33235, 86715, 226315, 592767, 1551791, 4060203, 10630767, 27825227, 72843667, 190710291, 499271047, ....  Start the Program by entering the value of n. Example: n = 5, m = Fibonacci(6) = 8, Farey(8) = 23, Farey(8; I) = 19, Grand Set(5) = 37.  These sequences occur in the upper bound of networks formed by n equal resistors.  Author: Sameen Ahmed KHAN, rohelakhan@yahoo.com, http://SameenAhmedKhan.webs.com/ and http://sites.google.com/site/rohelakhan/ E-Print archive: http://arxiv.org/abs/1004.3346/ (21 April 2010) Date: Wednesday the 21 April 2010*)

n = 5; 
m = Fibonacci[n + 1];
FareyFibonacci = Union[Flatten[Table[a/b, {b, m}, {a, 0, b}]]];
FareyInterval = Select[FareyFibonacci, # ≥ 1/n &];
GrandSetInterval = Union[FareyInterval, 1/FareyInterval];
(*Print[StringForm["n = ``, m = Fibonacci(n + 1) = ``, Farey Fibonacci Set = ``, Order of Farey Set = ``, Farey Fibonacci Set in the Interval I, [1/n, 1] = ``,  
                 Order of Farey Fibonacci Set in the Interval I, [1/n, 1] = ``",  
                  n, m, FareyFibonacci, Dimensions[FareyFibonacci], FareyInterval, Dimensions[FareyInterval] ]]*)
(*This line prints the Farey Fibonacci Set, Farey Fibonacci Set in the Interval with their orders*)
Print[StringForm["n = ``, m = Fibonacci(n + 1) = ``, Grand Set in the Interval I, [1/n, n] = ``, Order of Grand Set  in the Interval I, [1/n, n] = ``",  
                  n, m, GrandSetInterval, Dimensions[GrandSetInterval] ]]
(*This line prints the Grand Set in the Interval with its oder*)
Print[StringForm["n = ``, m = Fibonacci(n + 1) = ``,   
                 Order of Farey Fibonacci Set in the Interval I, [1/n, 1] = ``, Order of Grand Set  in the Interval I, [1/n, n] = ``, CPU time in seconds = ``",  
                  n, m, Dimensions[FareyInterval], Dimensions[GrandSetInterval], TimeUsed[%] ]]