egyptian_methods: Egyptian Fractions - Specialized Methods

View source: R/egyptian.R

egyptian_methodsR Documentation

Egyptian Fractions - Specialized Methods

Description

Generate Egyptian fractions with specialized methods.

Usage

  egyptian_methods(a, b)

Arguments

a, b

integers, a != 1, a < b and a, b relatively prime.

Details

For a rational number 0 < a/b < 1, generates Egyptian fractions that is finds integers x1, x2, ..., xk such that

a/b = 1/x1 + 1/x2 + ... + 1/xk

using the following methods:

  • ‘greedy’

  • Fibonacci-Sylvester

  • Golomb (same as with Farey sequences)

  • continued fractions (not yet implemented)

Value

No return value, all solutions found will be printed to the console.

References

https://www.ics.uci.edu/~eppstein/numth/egypt/

See Also

egyptian_complete

Examples

egyptian_methods(8, 11)
# 8/11 = 1/2 +  1/5 + 1/37 + 1/4070  (Fibonacci-Sylvester)
# 8/11 = 1/2 +  1/6 + 1/21 + 1/77    (Golomb-Farey)

# Other solutions
# 8/11 = 1/2 +  1/8 + 1/11 + 1/88
# 8/11 = 1/2 + 1/12 + 1/22 + 1/121

numbers documentation built on Nov. 23, 2022, 9:06 a.m.