A336992 The number of gaps in 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, 0, 1, 3, 3, 9, 9, 8, 12, 12, 14, 15, 15, 16, 100, 99, 100, 100, 101, 108, 108, 112, 111, 110, 110, 110, 110, 111, 110, 116, 115, 115, 115, 116, 120, 120, 124, 123, 122, 122, 121, 122, 122, 123, 125, 124, 125, 125, 126, 125, 125, 127, 127, 126, 133, 133
Offset: 0
Keywords
Links
- Markus Sigg, Table of n, a(n) for n = 0..999
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; }; nGaps(A) = { my(i,c=0); for (i=2, #A, if (A[i-1] < A[i]-1, c = c+1;)); c; }; makeVec(m) = { my(v = [], A = Set([]), i); for(i = 1, m, v = concat(v, nGaps(A)); if (i < m, A = iter(A))); v; }; makeVec(57)
Comments