OFFSET
1,2
COMMENTS
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
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..5655
D. Applegate, M. LeBrun and N. J. A. Sloane, Dismal Arithmetic, arXiv:1107.1130 [math.NT], 2011. [Note: we have now changed the name from "dismal arithmetic" to "lunar arithmetic" - the old name was too depressing]
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Aug 31 2010
STATUS
approved