A374527
Odd numbers whose Collatz trajectory is a Sidon sequence.
Original entry on oeis.org
1, 21, 85, 151, 227, 341, 1365, 5461, 14563, 21845, 87381, 349525, 932067, 1398101, 5592405, 22369621, 26512143, 39768215, 59652323, 89478485, 357913941, 1431655765, 3817748707, 5726623061
Offset: 1
-
from itertools import count, islice
def A374527_gen(startvalue=1): # generator of terms >= startvalue
s = max(startvalue,1)
for n in count(s+(s&1^1),2):
t, a, c = [n], n, set()
while a > 1:
a = 3*a+1 if a&1 else a>>1
for p in t:
if (b:=p+a) in c:
break
c.add(b)
else:
t.append(a)
continue
break
else:
yield n
A374527_list = list(islice(A374527_gen(),10)) # Chai Wah Wu, Jul 27 2024
A375650
a(n) is the cardinality of the sumset of the Collatz trajectory of n.
Original entry on oeis.org
1, 3, 23, 6, 18, 24, 69, 10, 71, 22, 68, 25, 41, 69, 125, 15, 61, 73, 104, 28, 36, 68, 110, 33, 115, 48, 3060, 69, 95, 131, 2951, 21, 133, 67, 92, 76, 108, 108, 297, 37, 3007, 45, 203, 76, 105, 117, 2914, 45, 147, 119, 183, 57, 70, 3081, 3060, 82, 228, 102, 284
Offset: 1
The Collatz trajectory of 3 is {3,10,5,16,8,4,2,1}, which has the sumset {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,24,26,32} of size 23, so a(3) = 23.
-
a(n) = {
my(T = List([n]), S = Set());
while(n > 1, n = if(n % 2 == 0, n/2, 3*n+1); listput(T, n));
for(i = 1, #T,
for(j = i, #T,
S = setunion(S, Set([T[i] + T[j]]));
)
);
#S
};
print(vector(59, n, a(n)));
-
def a(n):
T, S = [n], set()
while n > 1:
if n & 1 == 0: n >>= 1
else: n = 3 * n + 1
T.append(n)
for i in range(len(T)):
for j in range(i, len(T)):
S.add(T[i] + T[j])
return len(S)
print([a(n) for n in range(1, 60)]) # DarĂo Clavijo, Aug 24 2024
Showing 1-2 of 2 results.
Comments