SYRACUSE SIZE: 74 bytes.
MSA (“Modified Syracuse Algorithm”) is like the ULAM function (see
ULAMLEX), but counts how many steps it takes to fall below the
starting number, and counts (3x+1)/2 as one step. This value is
useful in rapid elimination of counterexamples to Ulam’s Conjecture.
Example: MSA(7) returns 7, because it takes 7 steps of the Modified
Syracuse Algorithm for 7 to fall below itself, viz.:
Start: 7
Step 1: (7*3+10)/2 = 11
Step 2: (11*3+1)/2 = 17
Step 3: (17*3+1)/2 = 26
Step 4: 26/2 = 13
Step 5: (13*3+1)/2 = 20
Step 6: 20/2 = 10
Step 7: 10/2 = 5, stop (because 5 < 7)
On the other hand, ULAM(7) (using the ULAMLEX file) returns 16,
because it takes 16 steps of the Syracuse Algorithm for 7 to reach 1.
If searching for counterexamples of Ulam's Conjecture, use MSA
instead of ULAM, because if any number x falls below itself, it will
surely reach 1, because all the numbers below x have already been
shown to reach 1. MSA(x) runs faster than ULAM(x) for all x>2.
*** SYRACUSE ***
(31898) File Header
(318EE) A0/1A MSA(#)
(31950) Next File Header