OFFSET
1,2
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).
LINKS
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_input = oeis_A006877[0]
record_stopping_time_metric = stopping_time_metric(record_input)
result.append(record_input)
for n in range(1, len(oeis_A006877)):
current_input = oeis_A006877[n]
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=", ")
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Matthew Russell Downey, Dec 10 2020
STATUS
approved