Post Reply 
Prime number finder HP11C?
06-15-2016, 10:59 PM (This post was last modified: 06-16-2016 02:19 AM by Valentin Albillo.)
Post: #5
RE: Prime number finder HP11C?
.
Hi again, jbhp55:

(06-14-2016 06:33 AM)jbhp55 Wrote:  Thank you, Valentin, for your reply.

You're welcome.

Quote:The conditions are: start with odd number in x, start program (say A).

I assume that by "start program (say A)" you mean that you start the program either by pressing the [A] key in USER mode or else pressing [GSB][A] in any mode (though you actually use LBL C in your program, not LBL A).

Quote:The program steps count. A final RTN may be omitted.

I assume you're interested in the shortest program possible which meets your specified requirements, not the fastest one.

Quote:My program:

01 LBL C
02 STO 1
[...]
23 +
24 GTO C

Subject to the aforementioned assumptions and requirements, a cursory glance at your code reveals that there's a fairly trivial technique which saves 2 steps, i.e. the length-optimized program is 22 steps long.

I'll refrain from spoiling the fun by posting it here right now, to give you the chance to re-examine your code and find it out yourself, but if you'd rather see it immediately just ask and I'll post it.

Best regards.
V.
.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Prime number finder HP11C? - jbhp55 - 06-13-2016, 07:15 PM
RE: Prime number finder HP11C? - jbhp55 - 06-14-2016, 06:33 AM
RE: Prime number finder HP11C? - Valentin Albillo - 06-15-2016 10:59 PM
RE: Prime number finder HP11C? - TASP - 06-14-2016, 11:35 PM
RE: Prime number finder HP11C? - jbhp55 - 06-16-2016, 07:56 PM
RE: Prime number finder HP11C? - jbhp55 - 06-17-2016, 07:08 AM
RE: Prime number finder HP11C? - Dieter - 06-17-2016, 06:42 PM
RE: Prime number finder HP11C? - Marcio - 06-27-2016, 10:17 PM
RE: Prime number finder HP11C? - jbhp55 - 06-17-2016, 10:43 AM
RE: Prime number finder HP11C? - rprosperi - 06-18-2016, 10:27 PM
RE: Prime number finder HP11C? - bshoring - 06-18-2016, 07:23 PM
RE: Prime number finder HP11C? - jbhp55 - 06-19-2016, 01:14 PM
RE: Prime number finder HP11C? - rprosperi - 06-19-2016, 08:03 PM
RE: Prime number finder HP11C? - jbhp55 - 06-19-2016, 01:17 PM
RE: Prime number finder HP11C? - jbhp55 - 06-19-2016, 05:35 PM
RE: Prime number finder HP11C? - rprosperi - 06-19-2016, 07:25 PM
RE: Prime number finder HP11C? - rprosperi - 06-20-2016, 12:05 AM
RE: Prime number finder HP11C? - jbhp55 - 06-19-2016, 09:28 PM
RE: Prime number finder HP11C? - rprosperi - 06-20-2016, 12:20 AM



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