A336256 The cardinalities of the sets A(n), where A(0) is the empty set and A(n+1) is the union of A(n) and the Collatz orbit of the smallest natural number missing in A(n).
0, 1, 4, 9, 10, 20, 23, 24, 33, 34, 39, 42, 43, 46, 141, 142, 145, 146, 149, 161, 162, 170, 173, 174, 179, 180, 187, 190, 191, 204, 205, 208, 209, 212, 220, 221, 230, 231, 232, 239, 240, 243, 244, 247, 252, 253, 256, 257, 260, 261, 262, 267, 270, 271, 284, 285
Offset: 0
Keywords
Programs
-
PARI
firstMiss(A) = { my(i); if(#A == 0 || A[1] > 0, return(0)); for(i = 1, A[#A] + 1, if(!setsearch(A,i), return(i))); }; iter(A) = { my(a = firstMiss(A)); while(!setsearch(A,a), A = setunion(A, Set([a])); a = if(a % 2, 3*a+1, a/2)); A; }; makeVec(m) = { my(v = [], A = Set([]), i); for(i = 1, m, v = concat(v, #A); if (i < m, A = iter(A))); v; }; makeVec(56)