login
A391769
The number of gaps in the set of positive integers which need at most n steps of the Collatz iteration to reach 1.
3
0, 0, 1, 2, 3, 4, 6, 7, 10, 14, 20, 26, 35, 45, 57, 73, 94, 121, 159, 202, 255, 322, 411, 520, 658, 836, 1057, 1339, 1696, 2143, 2711, 3429, 4340, 5494, 6949, 8788, 11130, 14077, 17796, 22506, 28466, 35998, 45516, 57504, 72652, 91805, 115991, 146577, 185230
OFFSET
0,4
COMMENTS
It appears that this sequence has the same asymptotic growth rate (3 + sqrt(21))/6 (A176014) as is conjectured for A005186.
LINKS
EXAMPLE
For n=5, the positive integers which need <= 5 Collatz steps to reach 1 and the a(5) = 4 gaps between runs in them are
1,2, 4,5, 8, 16, 32
gaps ^ ^ ^ ^
PROG
(Python)
def printUpTo(n):
L = [ 1 ]
T = [ 1 ]
print("0 0")
for i in range(1, n + 1):
L = [2*x for x in L] + [(x-1) // 3 for x in L if x > 4 and x % 6 == 4]
T = T + L
T.sort()
print(i, sum(1 for i in range(1, len(T)) if T[i - 1] < T[i] - 1))
printUpTo(48)
CROSSREFS
Sequence in context: A226137 A355393 A163771 * A194855 A272766 A271340
KEYWORD
nonn
AUTHOR
Markus Sigg, Dec 19 2025
STATUS
approved