[VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" Special
06-02-2018, 06:01 PM
Post: #34
 Jeff O. Member Posts: 196 Joined: Dec 2013
RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ...
(05-24-2018 09:13 PM)Valentin Albillo Wrote:
Jeff O. Wrote:In any case, a 10-fold or more increase in speed is really needed to make this practical. [...] I’ll keep thinking about the problem to see if I can develop a method that will be much quicker - hopefully it won’t keep me awake at night.

Please do. I'll post my original solution at 23:xx (GMT+1) next Sunday so you've got plenty of time to refine and expand your own.

Thanks to both and best regards.
V.

So as to not use anyone else's concepts for the time being, I have not reviewed Peter's work. Should anything I say or present below be a repetition of concepts presented by Peter, I fully acknowledge his priority.

In an effort to reduce execution time, I developed a method which basically checks 10 numbers at a time. I guess a better way to describe it would be to say that it determines if there is a solution between successive numbers that end in zero.

Since it is still basically just brute force, i.e., does not break any ground in attacking the problem in a super-efficient manner, I won't explain the procedure in detail. If anyone wants an explanation, I can provide it.

Since it effectively checks 10 numbers at a time, it seemed like a program based on the procedure should theoretically be up to 10 times faster than the previous program, as it checks all N+1 digit numbers by counting up to N. In practice, it appears that the various manipulations required to implement it eliminate some of the time saving. The speed-up seems to be more like a factor of 4 to 5. But with that improvement, I went ahead and turned it loose to find the 11-digit selfies. After (only) several days (again, on Free42 running on a couple of PCs), it found the seven 11-digit selfies:

15 694 046 123
52 249 382 004
30 609 287 624
97 653 680 744
60 605 588 394
87 561 939 628
41 919 540 249

The new program listing is presented below. Unfortunately, this program does not technically meet the original challenge. It cannot determine the single digit selfies from 1 through 9 since if you start counting at 1, it is checking candidates starting at 10. I could add code to just print out 1 through 9 at the start, but that seems unnecessary.

As noted, this is still essentially just brute force, and would be totally impractical on a DM42. Running on a physical machine in minutes or hours would require a massive speed-up factor. I'll keep trying to think of some other method to attack the problem that would be faster, but there's not much time until Sunday. Then I'll have to decide if I want to admit defeat and review Valentin's solution, or let it haunt me the rest of my days...

00 { 112-Byte Prgm }
01▸LBL "SELF"
02 CLA
03 CF 29
04 FIX 00
05 RCL 02
06 ARCL ST X
07 10
08 ×
09 ALENG
10 1
11 +
12 STO 00
13 R↓
14▸LBL 04
15 ATOX
16 X=0?
17 GTO 05
18 48
19 -
20 RCL 00
21 Y↑X
22 -
23 X<0?
24 GTO 08
25 GTO 04
26▸LBL 05
27 R↓
28 RCL ST X
29 RCL 00
30 1/X
31 Y↑X
32 1
33 +
34 IP
35 STO 11
36 RCL 00
37 Y↑X
38 RCL- 11
39 X≠Y?
40 GTO 08
41 10
42 RCL× 02
43 RCL+ 11
44 ARCL ST X
45 0
46 STO 01
47▸LBL 06
48 ATOX
49 X=0?
50 GTO 07
51 48
52 -
53 RCL 01
54 10↑X
55 ISG 01
56 DEG
57 ×
58 +
59 GTO 06
60▸LBL 07
61 R↓
62 PRX
63▸LBL 08
64 ISG 02
65 DEG
66 GTO "SELF"
67 END

Dave - My mind is going - I can feel it.
 « Next Oldest | Next Newest »

 Messages In This Thread [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" Special - Valentin Albillo - 05-04-2018, 09:39 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - J-F Garnier - 05-05-2018, 10:00 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - J-F Garnier - 05-05-2018, 03:44 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 05-05-2018, 05:53 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - rprosperi - 05-05-2018, 06:54 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - J-F Garnier - 05-08-2018, 04:16 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 05-09-2018, 10:53 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - J-F Garnier - 05-10-2018, 08:23 AM [VA] Short & Sweet Math Challenges #23 - My Solutions & Comments - Valentin Albillo - 05-10-2018, 09:55 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - rprosperi - 05-10-2018, 10:56 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 05-11-2018, 06:29 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - pier4r - 05-11-2018, 07:51 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Egan Ford - 05-11-2018, 07:57 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - J-F Garnier - 05-12-2018, 08:37 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 05-13-2018, 11:15 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - John Keith - 05-14-2018, 01:59 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 05-14-2018, 10:21 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Jeff O. - 05-15-2018, 05:22 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Maximilian Hohmann - 05-15-2018, 05:42 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - brickviking - 05-17-2018, 03:22 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 05-17-2018, 09:12 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - J-F Garnier - 05-20-2018, 02:50 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 05-20-2018, 11:01 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - rprosperi - 05-21-2018, 12:02 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 05-21-2018, 02:14 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - rprosperi - 05-21-2018, 02:42 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - J-F Garnier - 05-21-2018, 08:24 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 05-21-2018, 02:48 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Jeff O. - 05-24-2018, 05:10 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - cortopar - 05-12-2018, 11:59 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - PeterP - 05-24-2018, 06:14 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 05-24-2018, 09:13 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Jeff O. - 06-02-2018 06:01 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 06-02-2018, 10:37 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Jeff O. - 06-03-2018, 04:34 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 06-04-2018, 09:19 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Jeff O. - 06-06-2018, 01:48 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Jeff O. - 06-22-2018, 08:20 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Jeff O. - 10-24-2019, 01:26 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Jeff O. - 11-04-2019, 07:18 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Albert Chan - 11-05-2019, 11:17 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - PeterP - 05-25-2018, 01:57 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Warbucks - 06-03-2018, 04:52 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 06-07-2018, 03:10 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Thomas Klemm - 06-24-2018, 02:57 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - John Keith - 06-25-2018, 12:42 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Thomas Klemm - 06-25-2018, 01:41 PM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Valentin Albillo - 07-18-2018, 12:17 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - rprosperi - 07-18-2018, 01:10 AM RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - Jeff O. - 11-23-2019, 10:17 PM

User(s) browsing this thread: 1 Guest(s)