cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A261892 Least multiple m of n such that n and m have no common one bit in their binary representations.

Original entry on oeis.org

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

Views

Author

Paul Tek, Sep 05 2015

Keywords

Comments

All terms are even.
a(A003714(n)) = 2*A003714(n) for any n>0.
a(2n) = 2*a(n) for any n>0.
Without the condition on m being a multiple of n, then we'd get another sequence b(n) that seems to be A006519(n+1). - Michel Marcus, Sep 06 2015

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.
		

Crossrefs

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.