Post Reply 
an interesting problem
05-03-2015, 05:07 AM
Post: #14
RE: an interesting problem
For fun here is a 34S program to solve this problem, albeit not optimally since it doesn't exclude fives. Runs virtually instantly. I'm sure there are a lot of space savings to be had here and probably some algorithmic ones too.

- Pauli


Code:
01:  LBL A
02:  1
03:  .
04:  0
05:  0
06:  9
07:  0
08:  2
09:  +/-
10:  STO 00
11:  LBL 00
12:  ISG 00
13:  GTO 01
14:  RTN
15:  LBL 01
16:  RCL 00
17:  STO 01
18:  LBL 11
19:  ISG 01
20:  GTO 02
21:  GTO 00
22:  LBL 02
23:  RCL 01
24:  STO 02
25:  LBL 12
26:  ISG 02
27:  GTO 03
28:  GTO 11
29:  LBL 03
30:  RCL 00
31:  IP
32:  RCL 01
33:  IP
34:  RCL 02
35:  IP
36:  XEQ 20    
37:  GTO 12
38:  x<> Y
39:  XEQ 20    
40:  GTO 12
41:  <-> ZYXT
42:  XEQ 20    
43:  GTO 12
44:  x<> Y
45:  XEQ 20    
46:  GTO 12
47:  <-> ZYXT
48:  XEQ 20
49:  GTO 12
50:  x<> Y    
51:  XEQ 20
52:  GTO 12
53:  XEQ 30
54:  PSE 20
55:  GTO 12
56:  LBL 20
57:  XEQ 30
58:  PRIME?
59:  GTO 21
60:  RTN
61:  LBL 21
62:  DROP
63:  RTN+1
64:  LBL 30
65:  #100    
66:  RCL *T    
67:  #10    
68:  RCL *T    
69:  +    
70:  RCL+ Y    
71:  END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
an interesting problem - Don Shepherd - 05-02-2015, 08:37 PM
RE: an interesting problem - Gerald H - 05-02-2015, 09:05 PM
RE: an interesting problem - Don Shepherd - 05-02-2015, 09:53 PM
RE: an interesting problem - TASP - 05-02-2015, 11:27 PM
RE: an interesting problem - Don Shepherd - 05-02-2015, 11:44 PM
RE: an interesting problem - RayAtHP - 05-03-2015, 12:01 AM
RE: an interesting problem - Don Shepherd - 05-03-2015, 12:33 AM
RE: an interesting problem - Don Shepherd - 05-03-2015, 01:50 AM
RE: an interesting problem - Paul Dale - 05-03-2015, 03:10 AM
RE: an interesting problem - Paul Dale - 05-03-2015 05:07 AM
RE: an interesting problem - Paul Dale - 05-03-2015, 05:09 AM
RE: an interesting problem - Thomas Klemm - 05-03-2015, 05:42 AM
RE: an interesting problem - Don Shepherd - 05-03-2015, 06:49 AM
RE: an interesting problem - Don Shepherd - 05-03-2015, 04:21 PM
RE: an interesting problem - Joe Horn - 05-04-2015, 02:23 PM



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