« first day (4167 days earlier)      last day (615 days later) » 

ydd
ydd
18:10
I was inspired to do this when reading about Almost Integers and thought I would try something sort of similar. Here I wrote a small code that finds the best representation of E as a sum of inverse powers of Pi with integer coefficients. It just brute force searches over all combinations of integer coefficients in a small range. If anyone else wants to play around with it here it is:
```
maxPower = 5;
pTab = Table[ Pi^-i, {i, 0, maxPower}];
err[inp_] := Abs[inp . pTab - E];
maxInteger = 4;
tups = Tuples[Range[-maxInteger, maxInteger], maxPower + 1];
Also apparently I don't know how to format code blocks in chat... :(
 
1 hour later…
19:12
I am starting to port my 60,000 lines Maple program (which is step-by-step dsolve) to Mathematica. I am hoping it will not take me more than one year. I am sure I'll be asking more question here about how to implement some things I do now in Maple in Mathematica if I get stuck and I also need to get better in pattern Matching. Only thing I will miss is having a debugger to use which is very very useful.
Maple has a debugger which is command line based and not gui based. But it is better than nothing. I tried to debug using Mathematic'a workbench but it was not usable. I have posted a question about this here. I think I will have add lots of tracing messages.
 
1 hour later…
20:35
@ydd indent with 4 spaces in a message without any other text, you can also use ctrl-K to auto-indent
ydd
ydd
@b3m2a1 ok thanks. I will try it now as I wrote a version that uses QuadraticOptimization instead of a brute force search for finding coefficients. It is fast but does not always find the optimal values.
maxPower = 6;
maxInteger = 9;
pTab = Table[ Pi^-i, {i, 0, maxPower}];
soln = x /.
   QuadraticOptimization[
    Norm[Inactive[Plus][{pTab} .
       x, -{E}]], {-maxInteger \[VectorLessEqual]
      x \[VectorLessEqual] maxInteger}, x, Integers,
    Tolerance -> 10^(-20), PerformanceGoal -> "Quality"];
representation = pTab . soln
error = err[soln] // N
Haha! I did it
except I forgot to include definition of err in that code block err[inp_] := Abs[inp . pTab - E];

« first day (4167 days earlier)      last day (615 days later) »