Re: Math Challenge #8:- HP-12C Version Message #4 Posted by tony on 30 Apr 2005, 10:50 p.m., in response to message #3 by Bill (Smithville)
Bill, this 57 liner seems to do the job on the 12C. It takes 20-25 seconds to fully analyse a candidate though, and the user interface is not that friendly<G>.
Cheers,
Tony
R0 hits number : 0.300040003 ->only 1,5,9 in square
R1 33333 ->
R2 10 (convenient constant)
R3 total of non-zero hits. If >3 we skip
R4 counter 0->10
Example:
33333 STO 1 R/S
after 20 seconds see 3
rcl 1->33,334 enter * ->1,111,155,556
rcl 0->0.500041000
imagine 123456789
showing 5 1s, 4 5s and 1 6.
R/S, see 3, RCL 1 ->33,335
R/S 20-25 seconds, see 33,336... 33,337... 33,338
another stop etc.....
Keystrokes |Display | Comments
[f][P/R] | |
[f]CLEAR[PRGM] |00- |
[EEX] |01- 26 |
1 |02- 1 |
[STO]2 |03- 44 2 | R2=10
[CLx] |04- 35 | top of loop1
[STO]0 |05- 44 0 | initialize hits
1 |06- 1 |
[STO][+]1 |07- 44 40 1 |
[RCL]1 |08- 45 1 |
[g][PSE] |09- 43 31 | show current candidate
[ENTER] |10- 36 |
[x] |11- 20 |
[RCL]2 |12- 45 2 | top of loop2
[/] |13- 10 |
[g][INTG] |14- 43 25 | keep for recycling
[g][LSTx] |15- 43 36 |
[g][FRAC] |16- 43 24 |
[RCL]2 |17- 45 2 |
[x] |18- 20 | digit found
[g][x=0] |19- 43 35 | quick exit for 0
[g][GTO]04 |20- 43,33 04 | back to loop1
[CHS] |21- 16 | otherwise add
[RCL]2 |22- 45 2 | 10^(-digit) to
[x<>y] |23- 34 | the hits
[y^x] |24- 21 |
[STO][+]0 |25- 44 40 0 |
[RDN] |26- 33 | finish if remnant
[g][x=0] |27- 43 35 | is zero. Otherwise
[g][GTO]30 |28- 43,33 30 | stay in loop2
[g][GTO]12 |29- 43,33 12 |
[STO]3 |30- 44 3 | initialise digit
[STO]4 |31- 44 4 | count & counter
[RCL]0 |32- 45 0 | analyse hits
[g][FRAC] |33- 43 24 | top of loop3
[RCL]2 |34- 45 2 |
[x] |35- 20 |
[g][INTG] |36- 43 25 | augment counter
[STO][+]4 |37- 44 40 4 |
[g][LSTx] |38- 43 36 | remnant
[x<>y] |39- 34 |
[g][x=0] |40- 43 35 | if no digits don't
[g][GTO]45 |41- 43,33 45 | augment count
1 |42- 1 |
[STO][+]3 |43- 44 40 3 |
[RDN] |44- 33 |
[RDN] |45- 33 |
[RCL]2 |46- 45 2 | if 10 digits
[RCL]4 |47- 45 4 | already found
[-] |48- 30 | we are finished
[g][x=0] |49- 43 35 |
[g][GTO]53 |50- 43,33 53 |
[RDN] |51- 33 | otherwise
[g][GTO]33 |52- 43,33 33 | stay in loop3
3 |53- 3 |
[RCL]3 |54- 45 3 |
[g][x<=y] |55- 43 34 | stop if 3 or less
[R/S] |56- 31 | different digits
[g][GTO]04 |57- 43,33 04 | bottom of loop1
[f][P/R] | |
|