cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A375650 a(n) is the cardinality of the sumset of the Collatz trajectory of n.

This page as a plain text file.
%I A375650 #27 Aug 26 2024 11:43:33
%S A375650 1,3,23,6,18,24,69,10,71,22,68,25,41,69,125,15,61,73,104,28,36,68,110,
%T A375650 33,115,48,3060,69,95,131,2951,21,133,67,92,76,108,108,297,37,3007,45,
%U A375650 203,76,105,117,2914,45,147,119,183,57,70,3081,3060,82,228,102,284
%N A375650 a(n) is the cardinality of the sumset of the Collatz trajectory of n.
%C A375650 "Sumset" of a set S = {s_i} means the set of sums of pairs, s_i + s_j with i <= j.
%H A375650 Markus Sigg, <a href="/A375650/b375650.txt">Table of n, a(n) for n = 1..10000</a>
%e A375650 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.
%o A375650 (PARI) a(n) = {
%o A375650   my(T = List([n]), S = Set());
%o A375650   while(n > 1, n = if(n % 2 == 0, n/2, 3*n+1); listput(T, n));
%o A375650   for(i = 1, #T,
%o A375650     for(j = i, #T,
%o A375650       S = setunion(S, Set([T[i] + T[j]]));
%o A375650     )
%o A375650   );
%o A375650   #S
%o A375650 };
%o A375650 print(vector(59, n, a(n)));
%o A375650 (Python)
%o A375650 def a(n):
%o A375650     T, S = [n], set()
%o A375650     while n > 1:
%o A375650         if n & 1 == 0: n >>= 1
%o A375650         else: n = 3 * n + 1
%o A375650         T.append(n)
%o A375650     for i in range(len(T)):
%o A375650         for j in range(i, len(T)):
%o A375650             S.add(T[i] + T[j])
%o A375650     return len(S)
%o A375650 print([a(n) for n in range(1, 60)]) # _DarĂ­o Clavijo_, Aug 24 2024
%Y A375650 A375006 is the list of those n for which a(n) < A008908(n) * (A008908(n) + 1) / 2.
%K A375650 nonn
%O A375650 1,2
%A A375650 _Markus Sigg_, Aug 24 2024