# Recognizing numbers

Posted 10 years ago
4455 Views
|
5 Replies
|
7 Total Likes
|
 Python's sympy has a function called nsimplify that can do this: >>> from sympy import *>>> nsimplify(4.242640687119286)3*sqrt(2)>>> nsimplify(pi, tolerance=1e-7)exp(141/895 + sqrt(780631)/895)It finds closed form approximations to numbers.  This looks like a lot of fun (and is potentially useful).Original source: http://www.johndcook.com/blog/2013/04/30/recognizing-numbers/So, can Mathematica do this?Cheers,Mike
5 Replies
Sort By:
Posted 10 years ago
 Thanks for the replies everyone
Posted 10 years ago
 Hello Mike,One of the very first posts on Mathematica.SE was on a similar topic:http://mathematica.stackexchange.com/questions/16/can-mathematica-propose-an-exact-value-based-on-an-approximate-oneBe sure to look at all answers (not just highly voted ones), and follow the links.  I asked a similar question on MathGroup a few years ago which also has interesting answers:https://groups.google.com/d/msg/comp.soft-sys.math.mathematica/vq-MBdu51RI/lvNoiwHUPv8JIt was inspired by Maple's identify() function.
Posted 10 years ago
 BTW the same function was used to recover some of the Ramanujan lost equations, as discussed in this latest Wolfram Blog: After 100 Years, Ramanujan Gap Filled . Below is the image from his "lost notebook" showing some incomplete equations. Click on the link or the image to read the full blog.
Posted 10 years ago
 Built in functionRootApproximant[4.242640687119286]Out = 3*Sqrt[2]works, and so does the Wolfram|Alpha query with quite a few results:http://www.wolframalpha.com/input/?i=4.242640687119286 Recent post at Wolfram Blog From Close to PerfectA Triangle Problem  just discussed this very issue.Hope that helps.
Posted 10 years ago
 Very nice. Thank you.