A078645 Duplicate of A067139.
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
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.
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).
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
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
A067398(5) = 21 since [5] * [5] = [21] in OR-numbral arithmetic.
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
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
15 is in A067400 since [15] = [3] * [5] = [3]^3 and [3] and [5] are irreducible.
15 is in A067401 since [15] = [3] * [5] = [3]^3 all divisors of [15] are uniquely factorizable.
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.
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
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
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
Comments