Post Reply 
(12C) 3n + 1 conjecture
07-07-2018, 04:57 PM (This post was last modified: 07-07-2018 05:00 PM by Dieter.)
Post: #12
RE: (12C) 3n + 1 conjecture
(07-07-2018 02:24 PM)Joe Horn Wrote:  Ah, but the OP did not state that the entire sequence needs to be displayed, but rather only that the conjecture be tested.

In this case you can omit the PSE completely and wait until the program finishes with a "1". But the fun is watching the numbers go up und down. ;-)

Regarding the program: it does not display 3x+1 but (3x+1)/2. That's why I suggested the two additional steps in my last post.
If you modify your program accordingly...

Code:
01 ENTER
02 ENTER
03 2
04 /
05 ENTER
06 FRAC
07 X=0?
08 GTO 12
09 +
10 +
11 ENTER
12 +
13 1
14 X<>Y
15 X<=Y?
16 GTO 00
17 PSE
18 GTO 01

...it will return the correct sequence:

17 => 52 26 13 40 20 10 5 16 8 4 2 1

Note: the position of the PSE has been changed so that the final 1 is not displayed twice.

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


Messages In This Thread
(12C) 3n + 1 conjecture - Gamo - 07-06-2018, 10:16 AM
RE: (12C) 3n + 1 conjecture - Thomas Klemm - 07-06-2018, 06:59 PM
RE: (12C) 3n + 1 conjecture - Dieter - 07-06-2018, 07:25 PM
RE: (12C) 3n + 1 conjecture - Dieter - 07-06-2018, 07:13 PM
RE: (12C) 3n + 1 conjecture - Joe Horn - 07-06-2018, 09:50 PM
RE: (12C) 3n + 1 conjecture - Dieter - 07-07-2018, 07:36 AM
RE: (12C) 3n + 1 conjecture - Thomas Klemm - 07-06-2018, 10:31 PM
RE: (12C) 3n + 1 conjecture - Joe Horn - 07-07-2018, 03:10 AM
RE: (12C) 3n + 1 conjecture - Gamo - 07-07-2018, 01:51 AM
RE: (12C) 3n + 1 conjecture - Thomas Klemm - 07-07-2018, 08:37 AM
RE: (12C) 3n + 1 conjecture - Joe Horn - 07-07-2018, 02:24 PM
RE: (12C) 3n + 1 conjecture - Dieter - 07-07-2018 04:57 PM
RE: (12C) 3n + 1 conjecture - Joe Horn - 07-07-2018, 07:04 PM



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