March 2019
Intermediate to advanced
336 pages
9h 9m
English
The following snippet shows the main method. In the main method, reduced fraction series are printed using recursion:
// main methodfunc main() { var num int var l fraction var r fraction for num = 1; num <= 11; num++ { l = fraction{0, 1} r = fraction{1, 1} fmt.Printf("F(%d): %s ", num, l) g(l, r, num) fmt.Println(r) }
Run the following command to execute the farey_sequence.go file:
go run farey_sequence.go
The output is as follows:

The next section talks about the Fibonacci sequence data structure.
Read now
Unlock full access