Post Reply 
HHC 2019 will be in Reno, Nevada, Sept 21-22
09-25-2019, 01:53 AM
Post: #44
RE: HHC 2019 will be in Reno, Nevada, Sept 21-22
(09-23-2019 03:08 AM)Wes Loewer Wrote:  Here are my smallest and my fastest 50g entries:

smallest:
95 bytes
128 sec
Code:









«
100 DUP 999 START
 DUPDUP 
 10 MOD 
 LASTARG / 10 MOD 
 LASTARG /  
 3. ->LIST IP 3. ^ sigmaLIST
 == OVER IFT 1. +
NEXT
DROP
»

and fastest
154 bytes
21.4 sec
Code:












«
1. 9. FOR h
0. 9. FOR t
0. 9. FOR o
h 100. * t 10. * + o +
h DUPDUP * * t DUPDUP * * + o DUPDUP * * +
IF  OVER not= THEN
 DROP
END
NEXT NEXT NEXT
»

Based on Claudio’s idea:

Code:

« 2. ALOG 964.
  FOR k k DUP 2. ALOG IDIV2 10. IDIV2 3. →LIST DUP SQ * ∑LIST == k IFT
  NEXT
»

96 bytes, 214.7 seconds.

Your smallest one can get even smaller by simply replacing 100 with 2 ALOG (down to 89.5 bytes).

My very first program would take one minute to run, probably because of cubes being computed as 3 y^3, instead of DUP SQ. Now 21.7 seconds and incidentally 154 bytes long:

Code:

« 1. 9.
  FOR h 0. 9.
    FOR t 0. 9.
      FOR u h 10. * t + 10. * u + h DUP SQ * t DUP SQ * + u DUP SQ * + OVER ≠ { DROP } IFT
      NEXT
    NEXT
  NEXT
»
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2019 will be in Reno, Nevada, Sept 21-22 - Gerson W. Barbosa - 09-25-2019 01:53 AM



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