Displaying 21-29 of 29 results found.
0, 0, 3, 3, 4, 8, 20, 20, 35, 37, 47, 52, 57, 70, 83, 83, 91, 107, 123, 126, 127, 138, 149, 155, 174, 180, 287, 301, 315, 329, 431, 431, 453, 462, 471, 488, 505, 522, 552, 556, 661, 663, 688, 700, 712, 724, 824, 831, 851, 871, 891, 898, 905, 1013, 1121, 1136, 1164, 1179, 1207, 1222, 1237, 1340, 1443, 1443
MATHEMATICA
Accumulate @ Table[-1 + Length @ NestWhileList[If[OddQ[#], 3*# + 1, #/2] &, n, ! IntegerQ @ Log[2, #] &], {n, 1, 64}] (* Amiram Eldar, Apr 09 2022 *)
PROG
(PARI) ispow2(n)=n>>=valuation(n, 2); n==1;
f(n) = my(s); while(!ispow2(n), n=if(n%2, 3*n+1, n/2); s++); s; \\ A208981
1, 2, 3, 6, 7, 14, 19, 25, 31, 62, 107, 127, 255, 339, 479, 639, 799
a(n) is the least number not occurring in a Collatz trajectory of n steps.
+10
2
2, 3, 3, 3, 3, 3, 3, 6, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, 18, 25, 25, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27
EXAMPLE
a(5) = 3 because there are two trajectories with 5 steps, namely (32,16,8,4,2,1) and (5,16,8,4,2,1). 3 is the smallest number not appearing in both.
PROG
(Python)
# output in b-file format
from itertools import count
n = 0
for k in count():
m = k
s = 0
while m > 1:
m = m // 2 if m % 2 == 0 else 3*m+1
s += 1
while n < s:
print(n, k, flush=True)
n += 1
a(n) is the largest value in the '3x+1' trajectory of starting points producing a record number of steps.
+10
2
1, 2, 16, 16, 52, 52, 52, 88, 9232, 9232, 9232, 9232, 9232, 9232, 9232, 9232, 9232, 9232, 250504, 190996, 190996, 250504, 250504, 250504, 481624, 975400, 975400, 497176, 11003416, 11003416, 106358020, 18976192, 41163712, 106358020, 21933016, 104674192, 593279152
MATHEMATICA
s = Map[ToExpression,
StringSplit[
Import["https://oeis.org/ A006877/b006877.txt", "Data"][[2 ;; -1]]
][[All, -1]] ];
Map[Max@ NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, #, # > 1 &] &, s] (* Michael De Vlieger, Jan 13 2025 *)
In the '3x+1' problem, these values for the starting value set new records for both the number of steps and the highest point of trajectory before reaching 1.
+10
1
1, 2, 3, 7, 27, 703, 26623
COMMENTS
Both the 3x+1 steps and the halving steps are counted.
Numbers for which the number of squares in their Collatz trajectory sets a new record.
+10
1
1, 3, 9, 27, 133, 315, 747, 2799, 14175, 287061, 530079, 3061987, 18371925, 73487701, 195967203, 1175803221
EXAMPLE
a(1) = 1: the square 1 contained in every trajectory at the end,
a(2) = 3: 3 squares in 3 -> 10 -> 5 -> 4^2 -> 8 -> 2^2 -> 2 -> 1^2,
a(3) = 9: 4 squares in 3^2 -> 28 -> ... -> 10 -> as above,
a(4) = 27: the famous long trajectory A008884 includes the 5 squares 22^2, 11^2, 4^2, 2^2, 1^2,
a(5) = 133: 6 squares in 133 -> 20^2 -> 200 -> 10^2 -> 50 -> 5^2 -> ... -> 4^2, 2^2, 1^2,
a(6) = 315: 7 squares in 315 -> 946 -> ... -> 533 -> 40^2 -> 800 -> 20^2 -> as above,
a(7) = 747: 9 squares in 747 -> 2242 -> 1121 -> 58^2 -> 1682 -> 29^2 -> ... -> 1066 -> 533 -> as above.
PROG
(PARI) nextc(x) = if (x%2==0, x\2, 3*x+1);
a375093(upto=600000) = {my(m=0); for (k=1, upto, np=issquare(k); j=k; while (j>1, j=nextc(j); if (issquare(j), np++)); if (np>m, m=np; print1(k, ", ")))}
Maximal number of halving and tripling steps to reach 1 in '3x+1' problem for range (1, ..., n).
+10
0
1, 2, 8, 8, 8, 9, 17, 17, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 24, 24, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113
MATHEMATICA
nst[n_]:=Length[NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>1&]]; nn=60; With[ {stps= Array[nst, nn]}, Table[Max[Take[stps, n]], {n, nn}]] (* Harvey P. Dale, Apr 17 2014 *)
AUTHOR
Benjamin Frost (benjamin.frost(AT)students.adelaide.edu.au), Sep 02 2008
Numbers that have the largest Collatz total stopping time of all numbers below 10^n. The smallest number is chosen in case of ties.
+10
0
9, 97, 871, 6171, 77031, 837799, 8400511, 63728127, 670617279, 9780657630, 75128138247, 989345275647, 7887663552367, 80867137596217, 942488749153153, 7579309213675935, 93571393692802302, 931386509544713451
COMMENTS
Collatz stopping time is defined as the number of steps that a number n takes to converge to 1 using one of the following steps:
0) if n is 1, stop.
1) if n is even, divide n by 2 (n/2).
2) if n is odd, multiply n by 3 and add 1 (3n+1).
LINKS
Gary T. Leavens and Mike Vermeulen, 3x+1 Search Programs, Computers & Mathematics with Applications. 24 (11): 79-99 (1992).
FORMULA
a(n) = max{i} (steps(i) for i in range from 1 to 10^n-1).
max(i) returns the i with the maximum steps(i) value.
where steps(n) is defined as follows
steps(n)= 0 if n=1.
1+steps(n/2) if n is even.
1+steps(3*n+1) if n is odd.
EXAMPLE
For n=1, steps(1) to steps(9) take the following values: 0, 1, 7, 2, 5, 8, 16, 3, 19; the maximum of all those is 19 which occurs for steps(9) therefore a(1)=9.
MATHEMATICA
Table[Last@Ordering@Array[If[#>1, #0@If[OddQ@#, 3#+1, #/2]+1, 0]&, 10^k], {k, 4}] (* Giorgos Kalogeropoulos, Apr 01 2021 *)
PROG
(Python 3.4)
def steps(n):
if n==1:
return 0
else:
if (n%2)==0:
return 1+steps(int(n/2))
else:
return 1+steps(3*n+1)
def max_steps(i):
a=max([[i, steps(i)] for i in range(1, 10**(i))], key=lambda x:x[1])
return a[0]
Inputs n that yield a record-breaking value of A008908(n)/(log_2(n)+1) for the Collatz conjecture.
+10
0
1, 3, 7, 9, 27, 26623, 35655, 52527, 142587, 156159, 230631, 626331, 837799, 1723519, 3542887, 3732423, 5649499, 6649279, 8400511, 63728127, 3743559068799, 100759293214567, 104899295810901231
COMMENTS
The metric A008908(n)/(log_2(n)+1) is always equal to 1 for any power of 2 (where 1 is the smallest possible value).
EXAMPLE
a(1) = 1, which is trivial, because the first element in any sequence is record setting.
a(5) = 27, because A008908(n)/(log_2(n)+1) yields a maximum value at n=27 among the first 27 elements, and there are 4 record-breaking elements beforehand.
PROG
(Python)
import math
oeis_ A006877 = [1, 2, 3, 6, 7, 9, 18, 25, 27, 54, 73, 97, 129, 171, 231, 313, 327, 649, 703, 871, 1161, 2223, 2463, 2919, 3711, 6171, 10971, 13255, 17647, 23529, 26623, 34239, 35655, 52527, 77031, 10623, 142587, 156159, 216367, 230631, 410011, 511935, 626331, 837799, 1117065, 1501353, 1723519, 2298025, 3064033, 3542887, 3732423, 5649499, 6649279, 8400511, 11200681, 14934241, 15733191, 31466382, 36791535, 63728127]
def stopping_time(n):
time = 1
while n>1:
n = 3*n + 1 if n & 1 else n//2
time += 1
return time
def stopping_time_metric(n):
time = stopping_time(n)
logarithmic_distance = (math.log(n, 2)+1)
return float(time/logarithmic_distance)
result = []
record_stopping_time_metric = stopping_time_metric(record_input)
result.append(record_input)
for n in range(1, len(oeis_ A006877)):
current_stopping_time_metric = stopping_time_metric(current_input)
if current_stopping_time_metric > record_stopping_time_metric:
record_input = current_input
record_stopping_time_metric = current_stopping_time_metric
result.append(record_input)
for n in range(len(result)):
print(result[n], end=", ")
Search completed in 0.025 seconds
|