Post Reply 
challenge
01-20-2015, 06:10 PM (This post was last modified: 05-23-2016 06:59 PM by Hlib.)
Post: #12
RE: challenge
(01-19-2015 03:06 PM)Don Shepherd Wrote:  How many integers (from 1 to 9999) are evenly divisible by the number of letters in their name?
...For you HP50 fans, I expect to see a one-line RPL program!...

I understand your irony :-) For such simple tasks a BASIC is more comfortable. First I wrote this program on CASIO-BASIC for FX-2.0 within an hour, while my algorithm on RPL did not finished yet.
Code:

[[0,3,3,5,4,4,3,5,5,4][3,6,6,8,8,7,7,9,8,8][0,0,6,6,5,5,5,7,6,6]]→Mat K:-1→N:0→K:
For 1→E To 10:Mat K[1,E]+8(E≠1)→S:
  For 1→D To 10:Mat K[1,D]+7(D≠1)+S→T:
    For 1→C To 10:Mat K[3,C]+T→U:(C=2)+1→B:
      For 1→A To 10:Mat K[B,A]+U→V:Isz N:(Frac (N/V)=0)+K→K:
      Next:
    Next:
  Next:
Next:"K=":K

N=9999 K=359 time=350sec size=256b
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
challenge - Don Shepherd - 01-19-2015, 03:06 PM
RE: challenge - Thomas Klemm - 01-19-2015, 07:22 PM
RE: challenge - Don Shepherd - 01-19-2015, 09:00 PM
RE: challenge - Gilles - 01-19-2015, 09:08 PM
RE: challenge - brickviking - 06-22-2018, 10:34 AM
RE: challenge - grsbanks - 06-22-2018, 10:40 AM
RE: challenge - Don Shepherd - 06-22-2018, 01:17 PM
RE: challenge - Thomas Okken - 06-22-2018, 02:22 PM
RE: challenge - burkhard - 06-22-2018, 03:10 PM
RE: challenge - Don Shepherd - 06-22-2018, 04:31 PM
RE: challenge - Don Shepherd - 06-22-2018, 06:14 PM
RE: challenge - Thomas Klemm - 01-19-2015, 09:12 PM
RE: challenge - Thomas Klemm - 01-19-2015, 09:19 PM
RE: challenge - Gilles - 01-19-2015, 09:37 PM
RE: challenge - Don Shepherd - 01-19-2015, 10:24 PM
RE: challenge - Katie Wasserman - 01-19-2015, 10:32 PM
RE: challenge - Don Shepherd - 01-19-2015, 10:52 PM
RE: challenge - Gilles - 01-19-2015, 10:55 PM
RE: challenge - Hlib - 01-20-2015 06:10 PM
RE: challenge - Gilles - 01-21-2015, 10:07 PM
RE: challenge - Hlib - 01-22-2015, 10:10 AM
RE: challenge - Hlib - 01-21-2015, 04:03 PM
RE: challenge - Don Shepherd - 01-21-2015, 04:14 PM
RE: challenge - Don Shepherd - 01-21-2015, 09:32 PM
RE: challenge - Gilles - 01-21-2015, 09:10 PM
RE: challenge - Hlib - 06-21-2018, 02:43 PM
RE: challenge - Paul Dale - 06-22-2018, 12:38 AM
RE: challenge - Don Shepherd - 06-22-2018, 01:25 AM
RE: challenge - grsbanks - 06-22-2018, 06:59 AM
RE: challenge - ijabbott - 06-22-2018, 07:24 AM
RE: challenge - grsbanks - 06-22-2018, 07:32 AM
RE: challenge - ijabbott - 06-22-2018, 04:26 PM
RE: challenge - Hlib - 06-22-2018, 10:08 PM
RE: challenge - Don Shepherd - 06-23-2018, 12:15 AM
RE: challenge - ijabbott - 06-23-2018, 09:20 AM
RE: challenge - Don Shepherd - 06-23-2018, 10:13 AM
RE: challenge - grsbanks - 06-23-2018, 10:22 AM
RE: challenge - Don Shepherd - 06-23-2018, 10:42 AM
RE: challenge - grsbanks - 06-23-2018, 10:48 AM
RE: challenge - Massimo Gnerucci - 06-23-2018, 12:45 PM
RE: challenge - Thomas Okken - 06-23-2018, 04:49 PM
RE: challenge - Massimo Gnerucci - 06-23-2018, 06:41 PM
RE: challenge - grsbanks - 06-23-2018, 07:38 PM
RE: challenge - Massimo Gnerucci - 06-23-2018, 08:42 PM



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