cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

Search algorithm wanted

AlfredFlaßhaar
13-Aquamarine

Search algorithm wanted

Hello,
In the solution to my recently asked question "programming a recursion" it was noted that MC has problems with the accuracy of long-number arithmetic. As a test in derive I have successfully solved the following task: To determine a power of two, i.e. 2^n for natural n, which begins with the decadic digit sequence 2023. I am interested in an MC-compatible search algorithm.
If you are interested, I would be happy to provide my derive solution as an attached text file. Which text format is desired here in this forum?

Kind regards, Alfred Flasshaar

1 ACCEPTED SOLUTION

Accepted Solutions

BTW, using brute force and Mathcads symbolic I found n=10103 to be the smallest solution for 2^n = 2023...

Werner_E_3-1682606352175.png

 

For at least the next ten years it gets easier 😉

Werner_E_4-1682606385321.png

A slight modification can bring up all solutions within a given range

Werner_E_1-1682612249367.png

MC15 file attached

View solution in original post

5 REPLIES 5

I would suggest to attach a pdf and the Derive file itself for dinosaurs like me which still have Derive installed on a machine.

 

According long-integer arithmetic - there is none in Mathcad. Mathcads numeric uses the usual IEEE format with its typical 15-16 significant digits precision and the symbolics also has its limits, I guess.

In contrast, Derive has always internally operated exclusively on integers of arbitrary length and could therefore provide "arbitrary" (limited by addressable memory) precision and was immune to rounding and conversion errors.
It was already in the DOS version an ingenious program with an unbelievable power on just one floppy disk.

BTW, using brute force and Mathcads symbolic I found n=10103 to be the smallest solution for 2^n = 2023...

Werner_E_3-1682606352175.png

 

For at least the next ten years it gets easier 😉

Werner_E_4-1682606385321.png

A slight modification can bring up all solutions within a given range

Werner_E_1-1682612249367.png

MC15 file attached

Yes, 10103 is the first/smallest solution ending in ...008. The closest solutions are 23404 with ...016 and 25540 with ...776. And there are more of them. It's amazing what derive can do. I found the first solution "manually" because of the high computing speed.

Not sure what you mean by "closest" solution and why the ending digits would be of interest.

The next two solutions are 12239 and 14375 and the powers end with ...9888 and ...3568 resp..

 

And what do you mean by "manually" finding the solution in Derive ?

Is there a clever, non-brute force mathematical way to get the solution(s)?

 

And yes, computing speed in Derive usually beats Mathcads symbolics.

p. s.

... only with help of derive´s "table".

Top Tags