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!)
A352993 a(n) is the n-th positive integer that has no common 1-bit with n; a(0) = 0. 1
0, 2, 4, 12, 8, 18, 24, 56, 16, 34, 36, 84, 48, 98, 112, 240, 32, 66, 68, 140, 72, 162, 168, 360, 96, 194, 196, 420, 224, 450, 480, 992, 64, 130, 132, 268, 136, 274, 280, 600, 144, 322, 324, 660, 336, 706, 720, 1488, 192, 386, 388, 780, 392, 834, 840, 1736 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
This sequence corresponds to the main diagonal of A295653.
To compute a(n):
- consider the binary expansion of n: Sum_{k >= 0} b_k * 2^k,
- and the positions of zeros in this binary expansion: {z_k, k >= 0},
- then a(n) = Sum_{k >= 0} b_k * 2^z(k).
LINKS
FORMULA
a(n) = A295653(n, n).
a(2^k) = 2^(k+1) for any k >= 0.
a(2^k-1) = A020522(k) for any k >= 0.
A000120(a(n)) = A000120(n).
A070939(a(n)) = A070939(n) + A000120(n).
EXAMPLE
For n = 43:
- the binary expansion of 43 is "... 0 0 0 0 1 0 1 0 1 1"
- so the binary expansion of a(43) is "... 1 0 1 0(0)1(0)1(0 0)",
- and a(43) = 660.
PROG
(PARI) a(n) = { my (m=n, v=0); for (e=0, oo, if (n==0, return (v), !bittest(m, e), if (n%2, v+=2^e; ); n\=2)) }
(Python)
def a(n):
b = bin(n)[2:][::-1]
z = [k for k, bk in enumerate(b+'0'*(len(b)-b.count('0'))) if bk=='0']
return sum(int(bk)*2**zk for bk, zk in zip(b, z))
print([a(n) for n in range(56)]) # Michael S. Branicky, Apr 21 2022
CROSSREFS
Sequence in context: A261892 A278225 A186118 * A363250 A181817 A362227
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 14 2022
STATUS
approved

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 July 25 16:17 EDT 2024. Contains 374612 sequences. (Running on oeis4.)