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-10 of 11 results. Next

A078645 Duplicate of A067139.

Original entry on oeis.org

1, 2, 3, 5, 9, 11, 13, 17, 19, 23, 25, 29, 33, 35, 37, 39, 41, 43, 49, 53, 57, 65, 67, 69, 71
Offset: 1

Views

Author

Keywords

A067138 OR-numbral multiplication table, read by antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 4, 3, 0, 0, 4, 6, 6, 4, 0, 0, 5, 8, 7, 8, 5, 0, 0, 6, 10, 12, 12, 10, 6, 0, 0, 7, 12, 15, 16, 15, 12, 7, 0, 0, 8, 14, 14, 20, 20, 14, 14, 8, 0, 0, 9, 16, 15, 24, 21, 24, 15, 16, 9, 0, 0, 10, 18, 24, 28, 30, 30, 28, 24, 18, 10, 0, 0, 11, 20, 27, 32, 31, 28
Offset: 0

Views

Author

Jens Voß, Jan 02 2002

Keywords

Comments

See A048888 for the definition of OR-numbral arithmetic

Examples

			The top left 0..16 x 0..16 corner of the array:
  0,  0,  0,  0,  0,  0,  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  0,  1,  2,  3,  4,  5,  6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  0,  2,  4,  6,  8, 10, 12,  14,  16,  18,  20,  22,  24,  26,  28,  30,
  0,  3,  6,  7, 12, 15, 14,  15,  24,  27,  30,  31,  28,  31,  30,  31,
  0,  4,  8, 12, 16, 20, 24,  28,  32,  36,  40,  44,  48,  52,  56,  60,
  0,  5, 10, 15, 20, 21, 30,  31,  40,  45,  42,  47,  60,  61,  62,  63,
  0,  6, 12, 14, 24, 30, 28,  30,  48,  54,  60,  62,  56,  62,  60,  62,
  0,  7, 14, 15, 28, 31, 30,  31,  56,  63,  62,  63,  60,  63,  62,  63,
  0,  8, 16, 24, 32, 40, 48,  56,  64,  72,  80,  88,  96, 104, 112, 120,
  0,  9, 18, 27, 36, 45, 54,  63,  72,  73,  90,  91, 108, 109, 126, 127,
  0, 10, 20, 30, 40, 42, 60,  62,  80,  90,  84,  94, 120, 122, 124, 126,
  0, 11, 22, 31, 44, 47, 62,  63,  88,  91,  94,  95, 124, 127, 126, 127,
  0, 12, 24, 28, 48, 60, 56,  60,  96, 108, 120, 124, 112, 124, 120, 124,
  0, 13, 26, 31, 52, 61, 62,  63, 104, 109, 122, 127, 124, 125, 126, 127,
  0, 14, 28, 30, 56, 62, 60,  62, 112, 126, 124, 126, 120, 126, 124, 126,
  0, 15, 30, 31, 60, 63, 62,  63, 120, 127, 126, 127, 124, 127, 126, 127,
  0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240,
.
Multiplying 3 ("11" in binary) with itself in this system means taking bitwise-or of "11" with itself, when shifted one bit-position left:
       11
      110
  -------
OR:   111 = 7 in decimal = A(3,3).
.
Multiplying 10 (= "1010" in binary) and 11 (= "1011" in binary) in this system means taking bitwise-or of binary number 1011 when shifted once left with the same binary number when shifted three bit-positions left:
      10110
    1011000
    -------
OR: 1011110 = 94 in decimal = A(10,11) = A(11,10).
		

Crossrefs

Cf. A003986, A067139, A048888, A007059, A067398 (main diagonal).
Cf. also A004247, A048720 for analogous multiplication tables.

Programs

  • PARI
    t(n, k) = {res = 0; for (i=0, length(binary(n))-1, if (bittest(n, i), res = bitor(res, shift(k, i)));); return (res);} \\ Michel Marcus, Apr 14 2013

Formula

From Rémy Sigrist, Mar 17 2021: (Start)
T(n, 0) = 0.
T(n, 1) = n.
T(n, 2^k) = n*2^k for any k >= 0.
T(n, n) = A067398(n).
(End)
For all n, k: A048720(n,k) <= A(n,k) <= A004247(n,k). - Antti Karttunen, Mar 17 2021

Extensions

Example-section rewritten by Antti Karttunen, Mar 17 2021

A067399 Number of divisors of n in OR-numbral arithmetic.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 3, 4, 2, 4, 2, 6, 2, 6, 5, 5, 2, 4, 2, 6, 3, 4, 2, 8, 2, 4, 4, 9, 2, 10, 8, 6, 2, 4, 2, 6, 2, 4, 2, 8, 2, 6, 2, 6, 4, 4, 4, 10, 2, 4, 4, 6, 2, 8, 4, 12, 2, 4, 4, 15, 4, 16, 14, 7, 2, 4, 2, 6, 2, 4, 2, 8, 3, 4, 2, 6, 2, 4, 2, 10, 2, 4, 2, 9, 5, 4, 2, 8, 2, 8, 4, 6, 2, 8, 6, 12, 2, 4, 4, 6
Offset: 1

Views

Author

Jens Voß, Jan 23 2002

Keywords

Comments

See A048888 for the definition of OR-numbral arithmetic. The example shows that this sequence is not multiplicative.
In other words, number of lunar divisors of n in base 2.

Examples

			a(15)=5 since [15] has the 5 OR-numbral divisors [1], [3], [5], [7] and [15].
If written as a triangle with rows of lengths 1,2,4,8,16,...:
1,
2, 2,
3, 2, 4, 3,
4, 2, 4, 2, 6, 2, 6, 5,
5, 2, 4, 2, 6, 3, 4, 2, 8, 2, 4, 4, 9, 2, 10, 8,
6, 2, 4, 2, 6, 2, 4, 2, 8, 2, 6, 2, 6, 4, 4, 4, 10, 2, 4, 4, 6, 2, 8, 4, 12, 2, 4, 4, 15, 4, 16, 14,
...,
the last terms in each row give A079500(n). The penultimate terms in the rows give 2*A079500(n-1). - _N. J. A. Sloane_, Mar 05 2011
		

Crossrefs

A079500 is the subsequence a(2^k-1). - N. J. A. Sloane, Feb 23 2011
See A188548 for the sum of the divisors.

A067398 Squares in OR-numbral arithmetic.

Original entry on oeis.org

0, 1, 4, 7, 16, 21, 28, 31, 64, 73, 84, 95, 112, 125, 124, 127, 256, 273, 292, 311, 336, 341, 380, 383, 448, 473, 500, 511, 496, 509, 508, 511, 1024, 1057, 1092, 1127, 1168, 1205, 1244, 1279, 1344, 1385, 1364, 1407, 1520, 1533, 1532, 1535, 1792, 1841, 1892
Offset: 0

Views

Author

Jens Voß, Jan 23 2002

Keywords

Comments

See A048888 for the definition of OR-numbral arithmetic.
Or, squares in lunar arithmetic base 2, written in base 10. - N. J. A. Sloane, Oct 02 2010
This sequence is not multiplicative; for example a(15) = 127 != 7 * 21 = a(3) * a(5). It is totally OR-numbral multiplicative: a([n] * [m]) = [a(n)] * [a(m)] in OR-numbral arithmetic. - Franklin T. Adams-Watters, Oct 27 2006

Examples

			A067398(5) = 21 since [5] * [5] = [21] in OR-numbral arithmetic.
		

Crossrefs

Programs

  • Haskell
    a067398 :: Integer -> Integer
    a067398 0 = 0
    a067398 n = orm n n where
       orm 1 v = v
       orm u v = orm (shiftR u 1) (shiftL v 1) .|. if odd u then v else 0
    -- Reinhard Zumkeller, Mar 01 2013

A171000 Irreducible Boolean polynomials written as binary vectors.

Original entry on oeis.org

1, 10, 11, 101, 1001, 1011, 1101, 10001, 10011, 10111, 11001, 11101, 100001, 100011, 100101, 100111, 101001, 101011, 110001, 110101, 111001, 1000001, 1000011, 1000101, 1000111, 1001011, 1001101, 1001111, 1010001, 1010011, 1010111, 1011001, 1011101, 1100001
Offset: 1

Views

Author

N. J. A. Sloane, Aug 31 2010

Keywords

Comments

These are the polynomials enumerated in A169912, and written in base 10 in A067139.
This sequence consists of 1 and the lunar primes in base 2 arithmetic. To construct the lunar base 2 primes, start with 10, and repeatedly adjoin the next smallest binary number that is not a lunar base-2 multiple of any earlier number. - N. J. A. Sloane, Jan 26 2011

Crossrefs

Base 3 lunar primes: A130206, A170806.

Programs

  • Python
    def addn(m1, m2):
        s1, s2 = "{0:b}".format(m1), "{0:b}".format(m2)
        len_max = max(len(s1), len(s2))
        return int(''.join(max(i, j) for i, j in zip(s1.rjust(len_max, '0'), s2.rjust(len_max, '0'))))
    def muln(m1, m2):
        s1, s2, prod =  "{0:b}".format(m1), "{0:b}".format(m2), '0'
        for i in range(len(s2)):
            k = s2[-i-1]
            prod = addn(int(str(prod), 2), int(''.join(min(j, k) for j in s1), 2)*2**i)
        return prod
    L_p10, m = [1], 2
    while m < 100:
        ct = 0
        for i in range(1, len(L_p10)):
            p = L_p10[i]
            for j in range(2, m):
                jp = int(str(muln(j, p)), 2)
                if jp > m: break
                if jp == m: ct += 1; break
            if ct > 0: break
        if ct == 0: L_p10.append(m)
        m += 1
    L_p2 = []
    for d in L_p10: L_p2.append("{0:b}".format(d))
    print(*L_p2, sep =', ') # Ya-Ping Lu, Dec 27 2020

A067400 Non-uniquely factorizable OR-numbrals, i.e., numbrals for which there exist more than one different factorizations into irreducible factors (modulo order).

Original entry on oeis.org

15, 30, 31, 60, 62, 63, 85, 95, 111, 120, 123, 124, 125, 126, 127, 170, 175, 190, 191, 207, 222, 223, 239, 240, 243, 245, 246, 247, 248, 250, 251, 252, 253, 254, 255, 340, 341, 350, 351, 367, 379, 380, 381, 382, 383, 399, 414, 415, 443, 444, 445, 446, 447
Offset: 1

Views

Author

Jens Voß, Jan 24 2002

Keywords

Comments

See A048888 for the definition of OR-numbral arithmetic.

Examples

			15 is in A067400 since [15] = [3] * [5] = [3]^3 and [3] and [5] are irreducible.
		

Crossrefs

A067401 Minimal non-uniquely factorizable OR-numbrals, i.e., numbrals that are not uniquely factorizable but for which all proper divisors are.

Original entry on oeis.org

15, 85, 95, 111, 123, 125, 175, 191, 207, 223, 239, 243, 245, 247, 251, 253, 351, 367, 379, 381, 399, 415, 443, 445, 447, 463, 483, 487, 493, 499, 501, 507, 585, 603, 621, 631, 639, 685, 687, 701, 725, 729, 731, 735, 757, 763, 783, 799, 827, 831, 873, 877
Offset: 1

Views

Author

Jens Voß, Jan 24 2002

Keywords

Comments

See A048888 for the definition of OR-numbral arithmetic.

Examples

			15 is in A067401 since [15] = [3] * [5] = [3]^3 all divisors of [15] are uniquely factorizable.
		

Crossrefs

A066376 Number of [*]-divisors d <= n such that there is another [*]-divisor d' < n with d [*] d' = n.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 2, 3, 1, 3, 1, 5, 1, 5, 4, 4, 1, 3, 1, 5, 2, 3, 1, 7, 1, 3, 3, 8, 1, 9, 7, 5, 1, 3, 1, 5, 1, 3, 1, 7, 1, 5, 1, 5, 3, 3, 3, 9, 1, 3, 3, 5, 1, 7, 3, 11, 1, 3, 3, 14, 3, 15, 13, 6, 1, 3, 1, 5, 1, 3, 1, 7, 2, 3, 1, 5, 1, 3, 1, 9, 1, 3, 1, 8, 4, 3, 1, 7, 1, 7, 3, 5, 1, 7, 5, 11, 1
Offset: 1

Views

Author

Marc LeBrun, Dec 22 2001

Keywords

Comments

Define [+] to be binary bitwise inclusive-OR and let [*] denote the shift-and-[+] product. ([+] is usually simply called OR.) Note that [*] is commutative, associative, and distributes over [+]. If x [*] y = z, we say x and y are [*]-divisors of z.

Examples

			14 has 5 [*]-divisors: 1, 2, 3, 6, 7, since for example 2 [*] 7 = 10 [*] 111 = 1110 OR 0000 = 1110; and 3 [*] 6 = 11 [*] 110 = 1100 OR 0110 = 1110.
		

Crossrefs

Cf. A067139 ("primes").
See A003986 for a table of [+] sums, A067138 for a table of [*] products.

Programs

  • Haskell
    import Data.Bits (Bits, (.|.), shiftL, shiftR)
    a066376 :: Int -> Int
    a066376 n = length [d | d <- [1..n-1], any ((== n) . (orm d)) [1..n]] where
       orm 1 v = v
       orm u v = orm (shiftR u 1) (shiftL v 1) .|. if odd u then v else 0
    -- Reinhard Zumkeller, Mar 01 2013

Extensions

Edited by N. J. A. Sloane, Dec 13 2021
Name corrected by Sean A. Irvine, Oct 10 2023

A342676 a(n) is the number of lunar primes less than or equal to n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7
Offset: 1

Views

Author

Ya-Ping Lu, Mar 18 2021

Keywords

Comments

The density of lunar primes seems to approach a nonzero fraction in contrast to that of the classical primes, which approaches zero as n tends to infinity. a(n) and lunar prime density, a(n)/n, for n up to 10^9 are
n 1 10 100 1000 10000 100000 1000000 10000000 100000000 1000000000
a(n) 0 0 18 99 1638 22095 264312 3159111 36694950 418286661
a(n)/n 0 0 0.18 0.099 0.164 0.221 0.264 0.316 0.367 0.418
Conjecture 1: Base 10 lunar prime density approaches 0.9 as n tends to infinity, or lim{n->oo} a(n)/n = 0.9.
D. Applegate, M. LeBrun and N. J. A. Sloane conjectured that the number of base b lunar primes with k digits approaches (b-1)^2*b^(k-2) as k tends to infinity. And necessary conditions for a number n to be prime are that it contain b-1 as a digit and (if k > 2) does not end with 0 (see Links). Since the number of base b integers with k digits equals b^k - b^(k-1), the lunar prime density among integers with k digits should be (b-1)^2*b^(k-2)/(b^k - b^(k-1)), which is 1 - 1/b as k -> oo, if the conjecture holds. Note that, as b increases, the limit approaches 1, or lim_{b->oo} lim_{n->oo} a(n)/n = 1. As n tends to infinity, the probability of finding a base b number having a digit of b-1 approaches 100%, and the probability of finding a base b number ending with 0 approaches 1/b. Therefore, essentially all numbers except those ending with 0 are lunar primes as n tends to infinity.
Conjecture 2: Base b lunar prime density approaches 1 - 1/b as n tends to infinity, or lim{n->oo} a(n)/n = 1 - 1/b.

Crossrefs

Programs

  • Python
    def addn(m1, m2):
        s1, s2 = str(m1), str(m2)
        len_max = max(len(s1), len(s2))
        return int(''.join(max(i, j) for i, j in zip(s1.rjust(len_max, '0'), s2.rjust(len_max, '0'))))
    def muln(m1, m2):
        s1, s2, prod = str(m1), str(m2), '0'
        for i in range(len(s2)):
            k = s2[-i-1]
            prod = addn(int(str(prod)), int(''.join(min(j, k) for j in s1))*10**i)
        return prod
    m = 1; m_size = 2; a = 0; L_im = [9]
    while m <= 10**m_size:
        for i in range(1, m + 1):
            if i == 9: continue
            im_st = str(muln(i, m)); im = int(im_st); im_len = len(im_st)
            if im_len > m_size: break
            if im not in L_im: L_im.append(im)
        if m not in L_im: a += 1
        print(a); m += 1

A342678 a(n) is the number of base-2 lunar primes less than or equal to n.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 22, 22, 23, 23, 24
Offset: 1

Views

Author

Ya-Ping Lu, Mar 18 2021

Keywords

Comments

a(n) and base-2 lunar prime density, a(n)/n, for some n up to 2^39 are
k n = 2^k a(n) a(n)/n
-- ------------ ------------ ----------
1 2 1 0.5
5 32 11 0.34375
10 1024 323 0.31542...
15 32768 5956 0.35430...
20 1048576 424816 0.40513...
25 33554432 14871345 0.44320...
30 1073741824 502585213 0.46806...
35 34359738368 16593346608 0.48292...
39 549755813888 269325457277 0.48990...
Conjecture: base-2 lunar prime density approaches 0.5 as n tends to infinity, i.e., lim_{n->oo} a(n)/n = 0.5 (see Comments section in A342676).
a(n) is the n-th partial sum of A342704.

Crossrefs

Programs

  • Python
    def addn(m1, m2):
        s1, s2 = bin(m1)[2:].zfill(0), bin(m2)[2:].zfill(0)
        len_max = max(len(s1), len(s2))
        return int(''.join(max(i, j) for i, j in zip(s1.rjust(len_max, '0'), s2.rjust(len_max, '0'))))
    def muln(m1, m2):
        s1, s2, prod = bin(m1)[2:].zfill(0), bin(m2)[2:].zfill(0), '0'
        for i in range(len(s2)):
            k = s2[-i-1]
            prod = addn(int(str(prod), 2), int(''.join(min(j, k) for j in s1), 2)*2**i)
        return prod
    m = 1; m_size = 7; a = 0; L_im = [1]
    while m <= 2**m_size:
        for i in range(2, m + 1):
            im_st = str(muln(i, m)); im = int(im_st, 2); im_len = len(im_st)
            if im_len > m_size: break
            if im not in L_im: L_im.append(im)
        if m not in L_im: a += 1
        print(a); m += 1
Showing 1-10 of 11 results. Next