(12C Platinum) 3n+1 Conjecture - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (12C Platinum) 3n+1 Conjecture (/thread-12023.html) |
(12C Platinum) 3n+1 Conjecture - Gamo - 12-25-2018 11:55 AM This program allows to test the 3n + 1 conjecture. Consider an integer n. If it's even, divide it by 2 (n÷2) If it's odd, multiply by 3 and add 1 (3n + 1) No matter what value of n, the sequence will always reach 1. The question is: if we start with an arbitrary integer will we always reach 1? Nobody knows. -------------------------------------- Procedure: Positive Integer Number [R/S] display 1 [X<>Y] display Total Iterations [RCL] 1 display how many time is Odd [RCL] 2 display how many time is Even -------------------------------------- Example: Desire Positive Integer Number is 7 7 [R/S] display 1 [X<>Y] display 16 // Total Iterations [RCL] 1 display 5 // Odd [RCL] 2 display 11 // Even ------------------------------------- Program: FIX 0 (ALG Mode) 38 steps Code:
***Let's try this on a much faster 12C Platinum Emulator.*** [EEX] 99 [R/S] display 1 [X<>Y] display 567 RCL 1 display 92 RCL 2 display 475 That 92 odds VS 475 even numbers !!! Gamo RE: (12C Platinum) 3n+1 Conjecture - Gamo - 12-27-2018 07:04 AM This is the updated version that included the Maximum Value as well. Procedure: (RPN mode) Mostly the same as previous post but added the Maximum Value. The maximum value is the highest point then each steps drop down to 1. n [R/S] display 1 [X<>Y] display Iterations [RCL] 1 display Odd [RCL] 2 display Even [RCL] 3 display Maximum ------------------------------------ Example: FIX 0 7 [R/S] display 1 [X<>Y] display 16 // Iterations [RCL] 1 display 5 // Odd [RCL] 2 display 11 // Even [RCL] 3 display 52 // Max ------------------------------------- Program: (RPN mode) Code:
Gamo RE: (12C Platinum) 3n+1 Conjecture - Nihotte(lma) - 04-05-2020 04:04 PM Hello, Gamo ! Nice program. I do appreciate the subject because I like to program this mathematical guess (known as Czech guess in French) to evaluate and test my new calculators. I've never thought to introduce the search of the maximum and the odd/even distribution in my program and I think you had a good idea ! I deliver you my current version for HP12C / HP12C+ ! Thanks ----------------------------------------------------------------------------------------------------------------- (12-27-2018 07:04 AM)Gamo Wrote: This is the updated version that included the Maximum Value as well. RE: (12C Platinum) 3n+1 Conjecture - Gamo - 04-06-2020 01:57 AM Nihotte(lma) Thanks for the review. Very nice program short and concise. Gamo RE: (12C Platinum) 3n+1 Conjecture - Nihotte(lma) - 11-01-2024 06:19 PM (04-06-2020 01:57 AM)Gamo Wrote: Nihotte(lma) Thanks for the review. Hi Gamo, A little tip that came to me when I wanted to improve the program on my new DM41. As a result, the HP12C also benefits from it! This gives the program below! Keep yourself healthy! Laurent Code:
|