OFFSET
0,4
COMMENTS
The number of gaps would be relevant for sparse representations of the sets A(n), which may be of use for a numerical verification of the Collatz conjecture up to a given number.
LINKS
Markus Sigg, Table of n, a(n) for n = 0..999
PROG
(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)
CROSSREFS
KEYWORD
nonn
AUTHOR
Markus Sigg, Aug 10 2020
STATUS
approved