## January 03, 2009

### Continued Fractions

Elementary school teaches you that the friendly way to write a big improper fraction like 3/2 is as a mixed fraction, that is, "an integer plus change" like 1½. Usually discussion of mixed fractions ends there. But mathematicians know there is a lot more fun you can have with mixed fractions if you restrict all numerators to "1".

A continued fraction is a mixed fraction where the numerators of the fraction parts are always "1". The trick that makes this interesting is that you are allowed to let the denominator be another continued fraction. For example, 2/3 can be written as a continued fraction by writing the reciprocal of 1½ like this:

=

The general procedure to turn any rational number into a continued fraction is this: First, separate and write any integer part bigger than 1. Then in the denominator write the continued fraction of the reciprocal of the fractional part.

You can use the form above to try any rational number as a continued fraction. For example, try 3/5, 355/113, or 1.414.

That last one is a decimal approximation for the square root of 2. What do you think the exact continued fraction for sqrt(2) would look like?

Posted by David at January 3, 2009 10:32 AM

Beautiful, tight code. But you know tables are evil. So do it with DIVs using the DOM!

Posted by: Tom at January 15, 2009 01:05 PM

https://www.hermesbelts-outlet.us.com/
https://www.fjallravenbackpack.us/
https://www.lebron16shoes.us/
https://www.nike-airmax95.us/
https://www.asics-runningsshoes.us.com/
https://www.vansshoes-outlets.us.com/
https://www.air-max95.us.com/
https://www.valentinoshoessale.us.com/
https://www.airjordan-retro11.us.com/
https://www.nikesclearance.us/
https://www.skechersgowalkshoes.us/
https://www.pandoracharmssales.us.com/
https://www.pandorajewelry-officialsites.us.com/
https://www.shoes-valentino.us.com/
https://www.pandorajewellerys.us.com/
https://www.ultra-boost.us.org/
https://www.asicsoutletonline.us.com/
https://www.boots-timberlands.us.com/
https://www.nikes-sneakers.us.com/
https://www.fjallravenkankenbackpack.us/
https://www.christian-louboutinoutletsale.us.com/
https://www.yeezyshoess.us.com/
https://www.ferragamo-shoes.us.org/
https://www.bottegasveneta.us.com/
https://www.pandora-charmssaleclearance.us.com/
https://www.christian-louboutins-shoes.us.com/
https://www.christian-louboutins.us.org/
https://www.fitflop-saleclearances.us.com/
https://www.red-bottomshoesforwomen.us.com/
https://www.pumas-shoes.us.com/
https://www.timberlands-shoes.us.com/
https://www.outletmonclers.us.com/
https://www.ferragamobelts.us.com/
https://www.yeezysneakersboost.us/
https://www.yeezyboosts-350.us.com/
https://www.new-nikeshoes.us/
https://www.longchampoutlet-onlines.us.com/
https://www.kevin-durantsshoes.us.com/
https://www.ultra-boosts.us.com/
https://www.christianlouboutinshoessaleoutlets.us/
https://www.red-bottomheels.us/
https://www.airmaxs-270.us.com/
https://www.nikeoutletstore-onlineshopping.us.com/
https://www.christian-louboutin-shoes.us.org/
https://www.pandoraoutlet-online.us.com/
https://www.nikeair-max270.us.com/
https://www.nikesneakersformenwomen.us/
https://www.filashoessale.us/
https://www.nikeshoesshop.us.com/
https://www.yeezyscheap.us.com/
https://www.nikeshoesonlines.us.com/
https://www.nikestores.us.org/
https://www.timberlands-outlets.us.com/
https://www.golden-gooses.us.com/
https://www.christianslouboutin.us.com/
https://www.pandorajewelry-site.us.com/
https://www.airjordanshoesretros.us.com/
https://www.kd11shoes.us.com/
https://www.yeezy500.us.org/
https://www.asicsshoes.us.org/
https://www.airjordans-sneakers.us/
https://www.christianlouboutins.us.org/
https://www.timberlands-shoes.us/
https://www.pandora-rings.us.org/
https://www.nikeoutletonlineclearance.us.com/
https://www.yeezy500boost.us.com/
https://www.airmaxs97.us.com/
https://www.timberlandworkboots.us.com/
https://www.yeezysneakers.us.com/
https://www.airmax270s.us.com/
https://www.goyard-handbags.us.org/
https://www.shoes-yeezy.us.com/
https://www.louboutinshoess.us/
https://www.pandora-earrings.us/
https://www.lebronjamesshoessale.us.com/
https://www.nike-runningshoes.us/
https://www.asicsshoesoutlet.us.com/
https://www.puma-outletstore.us.com/
https://www.pandora-braceletcharms.us.com/
https://www.pandora-jewelrystore.us.com/
https://www.pandoranecklaces.us/
https://www.michael-jordanshoes.us.com/
https://www.nikecortez.us.org/
https://www.red-bottomshoeslouboutin.us.com/
https://www.yeezy-supply.us.com/
https://www.nikecortezs.us/
https://www.pandorabracelets-charms.us.com/
https://www.jewelrycharms.us/
https://www.hermesshandbags.us.com/
https://www.nike-airmax98.us/
https://www.nike-outletstores.us.com/
https://www.fjallravens.us/
https://www.timberland-outletstore.us.com/
https://www.shoesyeezy.us.com/
https://www.filasneakers.us/
https://www.ferragamosshoes.us.com/
https://www.yeezysboosts.us.com/
https://www.nikeair-max270.us/
https://www.goyard-bags.us.org/
https://www.pandorabracelets-clearance.us.com/
https://www.valentinos.us.org/
https://www.airmax-98.us.com/
https://www.christianlouboutins-outlet.us.com/

Posted by: Nicholas at November 29, 2018 01:55 PM