A261892 Least multiple m of n such that n and m have no common one bit in their binary representations.
2, 4, 12, 8, 10, 24, 56, 16, 18, 20, 132, 48, 130, 112, 240, 32, 34, 36, 76, 40, 42, 264, 552, 96, 100, 260, 324, 224, 290, 480, 992, 64, 66, 68, 140, 72, 74, 152, 1560, 80, 82, 84, 516, 528, 450, 1104, 2256, 192, 196, 200, 204, 520, 1802, 648, 3080, 448
Offset: 1
Examples
For n=7: +---+-----+---------------+-----------------+ | k | 7*k | 7*k in binary | Common one bits | +---+-----+---------------+-----------------+ | 1 | 7 | 111 | 111 | | 2 | 14 | 1110 | 110 | | 3 | 21 | 10101 | 101 | | 4 | 28 | 11100 | 100 | | 5 | 35 | 100011 | 11 | | 6 | 42 | 101010 | 10 | | 7 | 49 | 110001 | 1 | | 8 | 56 | 111000 | 0 | +---+-----+---------------+-----------------+ Hence, a(7) = 56.
Links
- Paul Tek, Table of n, a(n) for n = 1..16384
Programs
-
Mathematica
Table[k = 1; While[BitAnd[k n, n] != 0, k++]; k n, {n, 60}] (* Michael De Vlieger, Sep 06 2015 *)
-
PARI
a(n) = {k=1; while (bitand(n, k*n), k++); k*n;} \\ Michel Marcus, Sep 06 2015
-
Perl
sub a { my $n = shift; my $m = $n; while ($n & $m) { $m += $n; } return $m; }
-
Python
from itertools import count def A261892(n): return next(k for k in count(n<<1,n) if not n&k) # Chai Wah Wu, Jul 19 2024
Formula
a(n) = n*A261891(n) for any n>0.
Comments