login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 1

%I #13 Aug 10 2020 14:33:31

%S 0,0,1,3,3,9,9,8,12,12,14,15,15,16,100,99,100,100,101,108,108,112,111,

%T 110,110,110,110,111,110,116,115,115,115,116,120,120,124,123,122,122,

%U 121,122,122,123,125,124,125,125,126,125,125,127,127,126,133,133

%N 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).

%C 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.

%H Markus Sigg, <a href="/A336992/b336992.txt">Table of n, a(n) for n = 0..999</a>

%o (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))); };

%o 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; };

%o nGaps(A) = { my(i,c=0); for (i=2, #A, if (A[i-1] < A[i]-1, c = c+1;)); c; };

%o makeVec(m) = { my(v = [], A = Set([]), i); for(i = 1, m, v = concat(v, nGaps(A)); if (i < m, A = iter(A))); v; };

%o makeVec(57)

%Y Cf. A061641, A336938.

%K nonn

%O 0,4

%A _Markus Sigg_, Aug 10 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 15 11:07 EDT 2024. Contains 375173 sequences. (Running on oeis4.)