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.

A123345 Numbers containing all divisors in their binary representation.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 19, 20, 22, 23, 24, 26, 28, 29, 31, 32, 34, 37, 38, 40, 41, 43, 44, 46, 47, 48, 52, 53, 55, 56, 58, 59, 61, 62, 64, 67, 68, 71, 73, 74, 76, 79, 80, 82, 83, 86, 88, 89, 92, 94, 96, 97, 101, 103, 104, 106, 107, 109, 112, 113, 116, 118
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 12 2006

Keywords

Crossrefs

Complement of A093642. Different from A093641.
Cf. A000040 (subsequence), A027750, A218388.

Programs

  • Haskell
    import Data.List (unfoldr, isInfixOf)
    a123345 n = a123345_list !! (n-1)
    a123345_list = filter
      (\x -> all (`isInfixOf` b x) $ map b $ a027750_row x) [1..] where
      b = unfoldr (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2)
    -- Reinhard Zumkeller, Oct 27 2012
    
  • Mathematica
    q[n_] := AllTrue[Divisors[n], StringContainsQ[IntegerString[n, 2], IntegerString[#, 2]] &]; Select[Range[100], q] (* Amiram Eldar, Jun 05 2022 *)
  • Python
    from sympy import divisors
    def ok(n):
        b = bin(n)[2:]
        return n and all(bin(d)[2:] in b for d in divisors(n, generator=True))
    print([k for k in range(119) if ok(k)]) # Michael S. Branicky, Jun 05 2022

A218403 Bitwise OR of all proper divisors of n; a(1) = 0 by convention.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 1, 7, 3, 7, 1, 7, 1, 7, 7, 15, 1, 15, 1, 15, 7, 11, 1, 15, 5, 15, 11, 15, 1, 15, 1, 31, 11, 19, 7, 31, 1, 19, 15, 31, 1, 31, 1, 31, 15, 23, 1, 31, 7, 31, 19, 31, 1, 31, 15, 31, 19, 31, 1, 31, 1, 31, 31, 63, 13, 63, 1, 55, 23, 47, 1, 63, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 28 2012

Keywords

Examples

			n=20: properDivisors(20) = {1, 2, 4, 5, 10}, 0001 OR 0010 OR 0100 OR 0101 OR 1010 = 1111 -> a(20) = 15;
n=21: properDivisors(21) = {1, 3, 7}, 001 OR 011 OR 111 = 111 -> a(21) = 7;
n=22: properDivisors(22) = {1, 2, 11}, 0001 OR 0010 OR 1011 = 1111 -> a(22) = 11;
n=23: properDivisors(23) = {1} -> a(23) = 23;
n=24: properDivisors(24) = {1, 2, 3, 4, 6, 8, 12}, 0001 OR 0010 OR 0011 OR 0100 OR 0110 OR 1000 OR 1100 = 1111 -> a(24) = 15;
n=25: properDivisors(25) = {1, 5}, 001 OR 101 = 101 -> a(25) = 5.
		

Crossrefs

Programs

  • Haskell
    import Data.Bits ((.|.))
    a218403 = foldl (.|.)  0 . a027751_row :: Integer -> Integer
    
  • Mathematica
    Table[BitOr@@Most[Divisors[n]],{n,80}] (* Harvey P. Dale, Nov 09 2012 *)
  • PARI
    A218403(n) = { my(s=0); fordiv(n,d,if(dAntti Karttunen, Oct 08 2017

Formula

a(n) <= A218388(n).
a(A000040(n)) = 1.
From Antti Karttunen, Oct 08 2017: (Start)
a(n) = A087207(A293214(n)).
A227320(n) <= a(n) <= A001065(n).
(End)

A328177 a(n) is the minimal value of the expression d OR (n/d) where d runs through the divisors of n and OR denotes the bitwise OR operator.

Original entry on oeis.org

1, 3, 3, 2, 5, 3, 7, 6, 3, 7, 11, 6, 13, 7, 7, 4, 17, 7, 19, 5, 7, 11, 23, 6, 5, 15, 11, 7, 29, 7, 31, 12, 11, 19, 7, 6, 37, 19, 15, 13, 41, 7, 43, 15, 13, 23, 47, 12, 7, 15, 19, 13, 53, 15, 15, 14, 19, 31, 59, 13, 61, 31, 15, 8, 13, 15, 67, 21, 23, 15, 71, 9
Offset: 1

Views

Author

Rémy Sigrist, Oct 06 2019

Keywords

Examples

			For n = 12:
- we have the following values:
    d   12/d  d OR (12/d)
    --  ----  -----------
     1    12           13
     2     6            6
     3     4            7
     4     3            7
     6     2            6
    12     1           13
- hence a(12) = min({6, 7, 13}) = 6.
		

Crossrefs

See A328176 and A328178 for similar sequences.
Cf. A218388.

Programs

  • Maple
    a:= n-> min(map(d-> Bits[Or](d, n/d), numtheory[divisors](n))):
    seq(a(n), n=1..100);  # Alois P. Heinz, Oct 09 2019
  • PARI
    a(n) = vecmin(apply(d -> bitor(d, n/d), divisors(n)))

Formula

a(n)^2 >= n with equality iff n is a square.
a(p) = p for any odd prime number p.

A306352 a(n) is the least k >= 0 such that all the positive divisors of n have a distinct value under the mapping d -> d AND k (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 2, 7, 10, 13, 2, 15, 4, 5, 6, 15, 16, 31, 2, 29, 6, 7, 2, 31, 12, 9, 10, 11, 4, 15, 2, 31, 42, 49, 6, 63, 4, 7, 6, 63, 8, 15, 2, 14, 14, 5, 2, 63, 18, 29, 18, 21, 4, 31, 6, 23, 18, 9, 2, 31, 4, 5, 14, 63, 76, 127, 2, 115, 6, 15, 2, 127, 8, 13
Offset: 1

Views

Author

Rémy Sigrist, Feb 09 2019

Keywords

Comments

This sequence has similarities with A167234.
Will every nonnegative integer appear in the sequence?

Examples

			For n = 15:
- the divisors of 15 are: 1, 3, 5 and 15,
- their values under the mapping d -> d AND k for k = 0..6 are:
  k\d|  1  3  5  15
  ---+-------------
    0|  0  0  0  0
    1|  1  1  1  1
    2|  0  2  0  2
    3|  1  3  1  3
    4|  0  0  4  4
    5|  1  1  5  5
    6|  0  2  4  6
- the first row with 4 distinct values corresponds to k = 6,
- hence a(15) = 6.
		

Crossrefs

Programs

  • PARI
    a(n) = my (d=divisors(n)); for (m=0, oo, if (#Set(apply(v -> bitand(v, m), d))==#d, return (m)))

Formula

a(2^k) = 2^k - 1 for any k >= 0.
a(n) = 2 iff n belongs to A002145.
a(n) <= A218388(n).
a(n) AND A218388(n) = a(n).
A000120(a(n)) = 1 iff n is a prime number.
Apparently:
- a(3^k) belongs to A131130 for any k > 0,
- a(5^k) belongs to A028399 for any k >= 0.
Showing 1-4 of 4 results.