Post Reply 
[VA] Short & Sweet Math Challenge #22: April 1st, 2018 Spring Special
04-07-2018, 06:02 PM
Post: #37
RE: [VA] Short & Sweet Math Challenge #22: April 1st, 2018 Spring Special
(04-07-2018 01:05 AM)Valentin Albillo Wrote:  
John Keith Wrote:Thank you Valentin for an interesting and fun challenge!
Though it seems like cheating, this HP49/50 program seems to meet all the rules for the main course, and it's hard to beat for size at 15.5 bytes:

<< ISPRIME? >>

Thanks for your appreciation and kind comments. As for the << ISPRIME? >> program I concur that it's quite short but, as they say, "the proof of the pudding is in the eating" so: What results does it give when applied to the six test numbers I gave ?



.

It returns 1 for numbers that are prime, and 0 for numbers that are composite. The results are correct for all 6 numbers in your challenge.

I meant my "solution" to be facetious since ISPRIME? is a built-in function. I did write a couple of ASCII-based programs but they weren't very impressive (87 bytes, 59.5 bytes if external libraries are allowed).

John
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] Short & Sweet Math Challenge #22: April 1st, 2018 Spring Special - John Keith - 04-07-2018 06:02 PM



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