A286262 Numbers whose binary expansion is a cubefree string.
0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 18, 19, 20, 21, 22, 25, 26, 27, 36, 37, 38, 41, 43, 44, 45, 50, 51, 52, 53, 54, 73, 74, 75, 76, 77, 82, 83, 86, 89, 90, 91, 100, 101, 102, 105, 107, 108, 109, 146, 147, 148, 150, 153, 154, 155, 164, 165, 166, 172, 173, 178, 179, 180, 181, 182
Offset: 1
Examples
7 is not in the sequence, because 7 = 111[2] contains three consecutive "1"s. 8 is not in the sequence, because 8 = 1000[2] contains three consecutive "0"s. More generally, no number congruent to 7 or congruent to 0 (mod 8) may be in the sequence. Even more generally, no number of the form m*2^(k+3) +- n, n < 2^k, can be in this sequence. 42 is not in the sequence, because 42 = 101010[2] contains three consecutive "10"s. From the comment follows that no number of the form 7*2^k, 8*2^k or 42*2^k may be in the sequence, for any k>=0. More generally, no number of the form 7*2^k + m, 8*2^k + m or 42*2^k + m may be in the sequence, for any 2^k > m >= 0.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000
Programs
-
Maple
isCubeFree:=proc(v) local n, L; for n from 3 to nops(v) do for L to n/3 do if v[n-L*2+1 .. n] = v[n-L*3+1 .. n-L] then RETURN(false) fi od od; true end; a:=[]; for n from 1 to 512 do if isCubeFree(convert(n, base, 2)) then a:=[op(a), n]; fi; od; a;
-
Python
from _future_ import division def is_cubefree(s): l = len(s) for i in range(l-2): for j in range(1,(l-i)//3+1): if s[i:i+2*j] == s[i+j:i+3*j]: return False return True A286262_list = [n for n in range(10**4) if is_cubefree(bin(n)[2:])] # Chai Wah Wu, May 06 2017
Formula
lim a(n)/n = infinity: sequence has asymptotic density 0.
Comments