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.

Showing 1-4 of 4 results.

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.

A353623 a(n) is the least k > 0 such that n and k*n can be added without carries in balanced ternary.

Original entry on oeis.org

1, 2, 3, 2, 2, 6, 3, 3, 2, 2, 2, 5, 2, 2, 6, 6, 5, 3, 3, 3, 3, 3, 6, 2, 2, 3, 2, 2, 2, 3, 2, 2, 9, 5, 12, 2, 2, 2, 12, 2, 2, 6, 6, 12, 11, 6, 6, 14, 5, 9, 8, 3, 3, 3, 3, 3, 3, 3, 9, 11, 3, 3, 3, 3, 3, 14, 6, 6, 2, 2, 9, 2, 2, 2, 3, 3, 6, 2, 2, 3, 2, 2, 2, 3, 2
Offset: 0

Views

Author

Rémy Sigrist, Apr 30 2022

Keywords

Comments

Two integers can be added without carries in balanced ternary if they have no equal nonzero digit at the same position.

Examples

			For n = 5:
- we consider the following cases:
      k  bter(k*5)  carries?
      -  ---------  --------
      1        1TT  yes
      2        101  yes
      3       1TT0  yes
      4       1T1T  yes
      5       10T1  yes
      6       1010  no
- so a(5) = 6.
		

Crossrefs

Cf. A059095, A261891 (binary analog), A353624.

Programs

  • PARI
    ok(u,v) = { while (u && v, my (uu=[0,+1,-1][1+u%3], vv=[0,+1,-1][1+v%3]); if (abs(uu+vv)>1, return (0)); u=(u-uu)/3; v=(v-vv)/3); return (1) }
    a(n) = for (k=1, oo, if (ok(n, n*k), return (k)))

Formula

a(n) = A353624(n) / n for any n > 0.
a(3*n) = a(n).

A331985 a(n) is the least positive k such that n AND floor(n/k) = 0 (where AND denotes the bitwise AND operator).

Original entry on oeis.org

1, 2, 2, 4, 2, 2, 4, 8, 2, 2, 2, 12, 4, 5, 8, 16, 2, 2, 2, 4, 2, 2, 12, 24, 4, 4, 5, 6, 8, 10, 16, 32, 2, 2, 2, 4, 2, 2, 4, 40, 2, 2, 2, 9, 12, 16, 24, 48, 4, 4, 4, 4, 5, 5, 6, 56, 8, 9, 10, 12, 16, 21, 32, 64, 2, 2, 2, 4, 2, 2, 4, 8, 2, 2, 2, 16, 4, 26, 40
Offset: 0

Views

Author

Rémy Sigrist, Feb 03 2020

Keywords

Comments

This sequence has similarities with A261891; here we divide and round down, there we multiply, in order to obtain a number with no common bit with the original.

Examples

			For n = 3:
- 3 AND floor(3/1) = 3,
- 3 AND floor(3/2) = 1,
- 3 AND floor(3/3) = 1,
- 3 AND floor(3/4) = 0,
- hence a(3) = 4.
		

Crossrefs

Programs

  • PARI
    a(n) = for (k=1, oo, if (bitand(n,n\k)==0, return (k)))

Formula

a(n) = 2 iff n is a positive Fibbinary number (A003714).

A374735 a(n) is the least k > 0 such that n and k*n can be added without carries in decimal.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 3, 5, 10, 1, 1, 1, 1, 1, 2, 2, 3, 10, 20, 1, 1, 1, 1, 1, 2, 2, 6, 5, 30, 1, 1, 1, 1, 1, 4, 7, 3, 20, 40, 1, 1, 1, 1, 1, 10, 5, 3, 5, 50, 2, 2, 2, 2, 6, 2, 2, 6, 30, 60, 2, 2, 2, 2, 5, 2, 2, 3, 15, 70, 3, 3, 3, 7, 3, 4, 12, 13, 40, 80, 5, 5
Offset: 0

Views

Author

Rémy Sigrist, Jul 18 2024

Keywords

Examples

			For n = 8:
- 1*8 = 8; computing 8 + 8 requires a carry,
- 2*8 = 16; computing 8 + 16 requires a carry,
- 3*8 = 24; computing 8 + 24 requires a carry,
- 4*8 = 32; computing 8 + 32 requires a carry,
- 5*8 = 40; computing 8 + 40 does not require a carry,
- so a(8) = 5.
		

Crossrefs

Cf. A007091, A261891 (analog for binary), A353623 (analog for balanced ternary), A374736.

Programs

  • PARI
    a(n, base = 10) = { for (k = 1, oo, if (sumdigits((k+1)*n, base) == sumdigits(n, base) + sumdigits(k*n, base), return (k););); }
    
  • Python
    from itertools import count
    def A374735(n):
        s = list(map(int,str(n)[::-1]))
        return next(k for k in count(1) if all(a+b<=9 for a, b in zip(s,map(int,str(k*n)[::-1])))) # Chai Wah Wu, Jul 19 2024

Formula

a(n) = 1 iff n belongs to A007091.
a(10*n) = a(n).
Showing 1-4 of 4 results.