login
A384189
Numbers whose number of zeros in their binary representation is not equal to 1.
1
1, 3, 4, 7, 8, 9, 10, 12, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82
OFFSET
1,2
COMMENTS
Numbers m such that A023416(m) != 1. Complement of A030130.
EXAMPLE
15 is a term since its binary representation 1111 has no zeros.
53 is a term since its binary representation 110101 has two zeros.
MATHEMATICA
Select[Range[100], DigitCount[#, 2, 0] != 1 &] (* Paolo Xausa, May 22 2025 *)
PROG
(Python)
def A384189(n):
def f(x):
l, s = x.bit_length(), bin(x)[2:]
if (m:=s.count('0'))>0: return n+s.find('0')+((m>1)^1)+(l*(l-3)>>1)
return n+(l*(l-1)>>1)
m, k = n, f(n)
while m != k: m, k = k, f(k)
return m
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Chai Wah Wu, May 21 2025
STATUS
approved