OFFSET
1,1
COMMENTS
Complement of A023758. Also numbers not the sum of consecutive powers of 2. - Omar E. Pol, Mar 04 2013
Equivalently, numbers not the difference of two powers of two. - Charles R Greathouse IV, Mar 07 2013
The terms >=9 are bases in which a power of 2 exists, which does not contain a digit that is a power of 2. In base 10, 2^16 = 65536 is such a number, as it does not contain any one-digit power of 2, which in base 10 are 1, 2, 4 and 8. - Patrick Wienhöft, Jul 28 2016
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Patrick Wienhöft, Python program
FORMULA
a(n) ~ n. In particular a(n) = n + (log_2 n)^2/2 + O(log n). - Charles R Greathouse IV, Mar 07 2013
A049502(a(n)) > 0. - Reinhard Zumkeller, Jun 17 2015
EXAMPLE
29 = 11101_2 is a term, "10" and "01" are contained (here overlapping).
MATHEMATICA
Select[Range@ 120, Function[d, Times @@ Total@ Map[Map[Function[k, Boole@ MatchQ[#, k]], {{1, 0}, {0, 1}}] &, Partition[d, 2, 1]] > 0]@ IntegerDigits[#, 2] &] (* Michael De Vlieger, Dec 23 2016 *)
PROG
(PARI) is(n)=n>>=valuation(n, 2); n+1!=1<<valuation(n+1, 2) \\ Charles R Greathouse IV, Mar 07 2013
(Haskell)
a101082 n = a101082_list !! (n-1)
a101082_list = filter ((> 0) . a049502) [0..]
-- Reinhard Zumkeller, Jun 17 2015
(Python)
def A101082(n):
def f(x): return n+((k:=x.bit_length())*(k-1)>>1)+sum(1 for i in range(k) if (1<<k)-(1<<i)<=x)
m, k = n, f(n)
while m != k: m, k = k, f(k)
return m # Chai Wah Wu, Feb 23 2025
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
Rick L. Shepherd, Nov 29 2004
STATUS
approved